我在 Nginx 1.4.1 上有以下 nginx 2 虚拟主机,但它不起作用。当我注释掉第一个虚拟主机时,它工作正常。下面给了我一个 503 错误。
有什么想法我应该尝试吗?
server {
listen *:80;
server_name website.co;
rewrite ^(.*) http://www.website.co$1 permanent;
}
server {
listen *:80;
server_name www.website.co;
index index.php;
root /var/www/html/website.co;
location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass unix:/tmp/website.co.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_intercept_errors on;
}
}
谢谢你