leftso 263 0 2018-08-31 07:58:56 编程技术 nginx tomcat

nginx代理Tomcat带路径的项目

location / {
                proxy_pass http://localhost:8080/v1/;
                proxy_set_header    REMOTE-HOST $remote_addr;
                proxy_set_header   Host $host; 
                proxy_set_header   X-Real-IP $remote_addr; 
                proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for; 
                #root   html;
                #index  index.html;
        }

        location /v1/ {
                proxy_pass http://localhost:8080/v1/;
                proxy_set_header    REMOTE-HOST $remote_addr;
                proxy_set_header   Host $host; 
                proxy_set_header   X-Real-IP $remote_addr; 
                proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for; 
                #root   html;
                #index  index.html;
        }