nginx -t "nginx: [warn] only the last index in "index" directive should be absolute in 6 "的问题解决

时间:2022-10-25 03:30:38

修改完nginx的配置文件之后,执行nginx -t命令提示"nginx: [warn] only the last index in "index" directive should be absolute in 6 "

相关代码段为:

 server
{
listen ;
server_name www.web1.com;
index index.jsp index.html index.htm
access_log /export/servers/nginx/logs/www.web1.com/access.log main;
error_log /export/servers/nginx/logs/www.web1.com/error.log warn;
#chunkin on;
error_page = @my_error;
location @my_error {
#chunkin_resume;
}
root /export/data/tomcatRoot/www.web1.com/; location / {
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://tomcat_web1;
expires 1d;
}
location /logs/ {
autoindex off;
deny all;
} }

发现问题没? 原来是第5行少了一个;号...

填上,解决...