nginx - nginix reverse proxy index configuration problem
阿神
阿神 2017-05-16 17:07:21
0
1
409

The correct index is configured, but when accessing it, it gets 403. Is it because the default page will only go to the server to find files instead of accessing them through URL, because this page is dynamically generated by the server.

server {
      listen          80;
      server_name     manage.vs.com;
      root            /lee/web/;
      location / {
        index login.html;
      }
      location ~ \.(do|jsp|json|html)$ {
        proxy_pass        http://127.0.0.1:8080;
        proxy_set_header  X-Real-IP $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header  Host $http_host;
      }
    }

Configuration is as above index login.html
This page can be opened if you directly enter http://manage.vs.com/login.html in the browser
But use the default http://manage. When vs.com is opened, a 403 error occurs because there is no login.html file in the specified root directory. This file is dynamically generated by the server.

阿神
阿神

闭关修行中......

reply all(1)
黄舟
server {
    listen          80;
    server_name     manage.vs.com;
    root            /lee/web/;
    location / {
        index login.html;
    }
    location ~ \.(do|jsp|json|html)$ {
        proxy_pass        http://127.0.0.1:8080;
        proxy_set_header  X-Real-IP $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header  Host $http_host;
    }
    location = / {
        proxy_pass        http://127.0.0.1:8080;
        proxy_set_header  X-Real-IP $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header  Host $http_host;
    }
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!