所以这里是我的问题:我试图访问每个文件都有同样的问题。 它总是把我发回index.html或显示我500服务器错误。 错误日志给我:“重写或内部redirect周期,而内部redirect到”/index.html“
这是我的configuration:
server { listen 80; root /var/www; index index.php index.html index.htm; server_name _; location / { try_files $uri $uri/ /index.html; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /var/www; } # pass the PHP scripts to FastCGI server listening on the php-fpm socket location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
有什么问题?
您的所有请求都通过“位置/”(除* .php脚本和50x.html)进行匹配。 所以,它检查index.html这样的请求,它找不到任何文件,并去/index.html(最后一个参数用于redirect)。
你想要什么情况?