server
{
listen 80;
server_name www.ju.com ju.com *.ju.com;
index index.php;
root /data/wwwroot/ju_2_1;
#error_page 404 /404.html;
location /
{
index index.php;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php last;
}
if ($host = 'ju.com') {
rewrite ^/(.*) http://www.ju.com/$1 permanent;
}
}
location ~ [^/]\.php(/|$)
{
# comment try_files $uri =404; to enable pathinfo
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
#include pathinfo.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log /home/wwwlogs/ju.log access;
}