server { listen 80; server_name www.xxxxxxx.com xxxxxxx.com; index index.php index.html index.htm default.html default.htm default.php; root /home/wwwroot/www.xxxxxxx.com/; include none.conf; #error_page 404 /404.html; #include enable-php.conf; include enable-php-pathinfo.conf; location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; } } if ($host != 'www.xxxxxxx.com' ) { rewrite ^/(.*)$ http://www.xxxxxxx.com/$1 permanent; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 12h; } location ~ /\. { deny all; } #access_log /home/wwwlogs/www.xxxxxxx.com.log; } |
location ~ [^/]\.php(/|$) { fastcgi_pass unix:/dev/shm/php-cgi.sock; fastcgi_index index.php; fastcgi_split_path_info ^(.+?\.php)(/.*)$; set $path_info $fastcgi_path_info; fastcgi_param PATH_INFO $path_info; try_files $fastcgi_script_name =404; include fastcgi.conf; } |