server { listen 80; server_name www.it.net.cn; rewrite ^(.*) http://it.net.cn$1 permanent; } server { listen 80; server_name it.net.cn; # root directive should be global root /var/www/it.net.cn/public/app/webroot/; access_log /var/www/it.net.cn/log/access.log; error_log /var/www/it.net.cn/log/error.log; location / { index index.php index.html index.htm; try_files $uri $uri/ /index.php?$uri&$args; } location ~ \.php$ { include /etc/nginx/fcgi.conf; fastcgi_pass 127.0.0.1:10005; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } (责任编辑:IT) |