我在nginx页面上没有找到404,在nginx错误日志文件中也没有错误。
server {
listen 6269;
server_name (domain);
root /home/temp;
index /_h5ai/public/index.php;
location / {
try_files $uri $uri/ =404;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
location ~* \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php-fpm/www.sock;
}
}X.0.X.190 - - [17/Nov/2018:21:50:57 +0000] "GET / HTTP/1.1" 404 571 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36" "-"
发布于 2018-11-17 22:46:15
nginx使用error作为error_log的默认日志级别。在404响应的情况下,此日志记录级别不会将任何内容输出到错误日志,因为这些都是web服务器操作范围内的微不足道的错误。
可以尝试在您的warn指令中使用notice、info或debug来更改日志级别,例如:
error_log /var/log/nginx/error.log notice;warn输出的信息比error多一点,notice比warn多一点。debug产生最详细的输出。
对于您的配置,您需要有以下文件才能使GET /请求正常工作:
/home/temp/_h5ai/public/index.phphttps://serverfault.com/questions/940538
复制相似问题