ssl部分的配置:
server {
listen 443 ssl;
#server_name 198.13.35.89 app.zhaoy6.com;
server_name cross.zhaoy6.com;
keepalive_timeout 100;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_certificate /etc/nginx/conf.d/ssl_key/zhaoy6.crt;
ssl_certificate_key /etc/nginx/conf.d/ssl_key/zhaoy6.key;
#ssl_certificate_key /etc/nginx/conf.d/ssl_key/zhaoy6_nopass.key;
sendfile on;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location / {
root /usr/share/nginx/html/cross;
#random_index on;
}
location ~ .*\.(jpg|gif|png)$ {
gzip on;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/css aplication/xml text/javascript application/x-httpd-php images/jpeg image/gif image/png;
root /usr/share/nginx/html/images;
}
location ~ .*\.(txt|xml)$ {
gzip on;
gzip_http_version 1.1;
gzip_comp_level 1;
gzip_types text/plain application/javascript application/x-javascript text/css aplication/xml text/javascript application/x-httpd-php images/jpeg image/gif image/png;
root /usr/share/nginx/html/doc;
}
location ~ .*\.(htm|html)$ {
#add_header Access-Control-Allow-Origin https://cross.zhaoy6.com;
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,OPTIONS;
root /usr/share/nginx/html/cross;
}
location ~ ^/download {
gzip_static on;
tcp_nopush on;
root /usr/share/nginx/html/download;
}
location ~ ^/desk {
root /usr/share/nginx/html/address/desk;
index index.html index.htm;
}
location ~ ^/mobile {
root /usr/share/nginx/html/address/mobile;
index index.html index.htm;
}
}