首页 > 解决方案 > NGINX URI 与周期代理通行证问题

问题描述

所以我们有一个设置,其中 nginx 是我们的反向代理,它在多个位置使用 proxy_pass 到 apache tomcat。我们遇到的问题是这样的:

http://example.com/sub/john-doe。)。--> ( http://192.168.1.10:8080/sub/john-doe )

通过本地访问( http://192.168.1.10:8080/sub/john-doe. )直接测试 tomcat工作正常。“句号”没有被删除。

nginx 中的正确配置是什么?

TIA

常用配置

    proxy_redirect      off;
    proxy_set_header    X-Real-IP $remote_addr;
    proxy_set_header    X-Forward-For $proxy_add_x_forwarded_for;
    proxy_set_header    X-Forwarded-Proto  $scheme;
    proxy_set_header    Host $http_host;
    add_header          X-XSS-Protection "1; mode=block";
    
    proxy_http_version  1.1;
    proxy_set_header    Upgrade $http_upgrade;
    proxy_set_header    Connection "upgrade";

    client_max_body_size    4000M;

    location /sub {
        proxy_pass   http://<ip>:8080/sub
    }

标签: javanginxtomcatnginx-reverse-proxy

解决方案


推荐阅读