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

时间:2022-09-16 07:28:28

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

相关代码段为:   

 1 server
2 {
3 listen 80;
4 server_name www.web1.com;
5 index index.jsp index.html index.htm
6 access_log /export/servers/nginx/logs/www.web1.com/access.log main;
7 error_log /export/servers/nginx/logs/www.web1.com/error.log warn;
8 #chunkin on;
9 error_page 411 = @my_error;
10 location @my_error {
11 #chunkin_resume;
12 }
13 root /export/data/tomcatRoot/www.web1.com/;
14
15
16 location / {
17 proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;
18 proxy_set_header Host $host;
19 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
20 proxy_pass http://tomcat_web1;
21 expires 1d;
22 }
23 location /logs/ {
24 autoindex off;
25 deny all;
26 }
27
28 }

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

填上,解决...