server {
listen 80;
listen [::]:80;
server_name gehaowu.com www.gehaowu.com;
add_header Strict-Transport-Security max-age=31536000;
if ($http_user_agent !~* baidu.com) {
rewrite ^/(.*) https://www.gehaowu.com/$1 permanent;
}
index index.html;
root /home/ghw/wwwroot;
error_page 404 /404.html;
error_page 403 /403.html;
error_page 500 502 503 504 /50x.html;
access_log /home/ghw/wwwlog/baidu.access.log;
error_log /home/ghw/wwwlog/baidu.error.log;
}
server {
listen 443 ssl spdy;
listen [::]:443 ssl spdy;
server_name gehaowu.com;
ssl_certificate keys/www.gehaowu.com.crt;
ssl_certificate_key keys/www.gehaowu.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA256:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EDH+aRSA+AESGCM:EDH+aRSA+SHA256:EDH+aRSA:EECDH:!DH:!aNULL:!eNULL:!MEDIUM:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED;
ssl_prefer_server_ciphers on;
add_header Strict-Transport-Security max-age=31536000;
ssl_session_cache shared:SSL:5m;
ssl_session_timeout 5m;
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate keys/www.gehaowu.com.crt;
resolver 8.8.4.4 8.8.8.8;
rewrite ^/(.*) https://www.gehaowu.com/$1 permanent;
}
server {
listen 443 ssl spdy;
listen [::]:443 ssl spdy ipv6only=on;
server_name www.gehaowu.com;
ssl_certificate keys/www.gehaowu.com.crt;
ssl_certificate_key keys/www.gehaowu.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA256:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EDH+aRSA+AESGCM:EDH+aRSA+SHA256:EDH+aRSA:EECDH:!DH:!aNULL:!eNULL:!MEDIUM:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED;
ssl_prefer_server_ciphers on;
add_header Strict-Transport-Security max-age=31536000;
ssl_session_cache shared:SSL:5m;
ssl_session_timeout 5m;
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate keys/www.gehaowu.com.crt;
resolver 8.8.4.4 8.8.8.8;
index index.html;
root /home/ghw/wwwroot;
error_page 404 /404.html;
error_page 403 /403.html;
error_page 500 502 503 504 /50x.html;
access_log /home/ghw/wwwlog/www.gehaowu.com.access.log;
error_log /home/ghw/wwwlog/www.gehaowu.com.error.log;
location = /bookcase {
return 301 /bookcase/;
}
location ^~ /bookcase {
proxy_pass https://gehaowu.github.io;
proxy_set_header Host gehaowu.github.io;
proxy_set_header X-Host gehaowu.github.io;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location = /life {
return 301 /life/;
}
location ^~ /life {
proxy_pass https://gehaowu.github.io;
proxy_set_header Host gehaowu.github.io;
proxy_set_header X-Host gehaowu.github.io;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~ /\. {
deny all;
}
location ~* ^/(favicon.ico|robots.txt|status.gif)$ {
allow all;
access_log /dev/null;
error_log /dev/null;
}
location ~* \.(html|htm|xml|rss|atom|txt|xhtml)$ {
expires 1d;
}
location ~* \.(css|gif|jpeg|jpg|js|png|ico|bmp|svg|doc|pdf|mp3|ogg|mp4|mpeg|webm|eot|ttf|woff)$ {
expires 7d;
}
}