server { listen 80; server_name www.pcmoto.com.cn; index index.html index.php; root /pcmoto/web/www; location ~ .*\.php$ { #root html; fastcgi_pass 172.17.0.3:9000; fastcgi_index index.php; #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; #include fastcgi_params; include fastcgi.conf; access_log /pcmoto/log/nginx/www_access.log; error_log /pcmoto/log/nginx/www_error.log; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|md)$ { expires 30d; access_log /pcmoto/log/nginx/cdn_access.log; error_log /pcmoto/log/nginx/cdn_error.log; } location ~ .*\.(js|css)?$ { expires 1h; access_log /pcmoto/log/nginx/cdn_access.log; error_log /pcmoto/log/nginx/cdn_error.log; } location ~ \.html$ { rewrite ^/mspace/archive-html-(.+)$ /mspace/archive.php?$1; rewrite ^/mspace/index-html-(.+)$ /mspace/index.php?$1; rewrite ^/wap/login-html-(.+)$ /wap/login.php?$1; rewrite ^/member/index-html-(.+)$ /member/index.php?$1; rewrite ^/index-html-(.+)$ /index.php?$1; rewrite ^/archive-html-(.+)$ /archive.php?$1; rewrite ^/info-html-(.+)$ /info.php?$1; } } server { listen 443; server_name www.pcmoto.com.cn; index index.html index.php; root /pcmoto/web/www; ssl on; ssl_certificate /pcmoto/conf/nginx/vhost/server.crt; ssl_certificate_key /pcmoto/conf/nginx/vhost/server.key; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; location ~ .*\.php?$ { #root html; fastcgi_pass 172.17.0.3:9000; fastcgi_index index.php; #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; #include fastcgi_params; include fastcgi.conf; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|md)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 1h; } location ~ \.html$ { rewrite ^/mspace/archive-html-(.+)$ /mspace/archive.php?$1; rewrite ^/mspace/index-html-(.+)$ /mspace/index.php?$1; rewrite ^/wap/login-html-(.+)$ /wap/login.php?$1; rewrite ^/member/index-html-(.+)$ /member/index.php?$1; rewrite ^/index-html-(.+)$ /index.php?$1; rewrite ^/archive-html-(.+)$ /archive.php?$1; rewrite ^/info-html-(.+)$ /info.php?$1; } access_log /pcmoto/log/nginx/www_access.log; error_log /pcmoto/log/nginx/www_error.log; }