开发者社区 问答 正文

nginx 跳转的问题? 400 报错

nginx 跳转的问题? 400 报错

用nginx 做跳转到 tomcat(端口18080)上面 访问 http://myhost/koo_tools/ 从nginx跳转到tomcat 

登录以后 自动变成了 http://myhost:18080/koo_tools/ 这是后就走的是tomcat了 不知道什么原因 请教

展开
收起
爱吃鱼的程序员 2020-06-01 13:38:11 615 分享 版权
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    http://www.oschina.net/code/snippet_12_21451

    看看红薯的这个文章,能不能对你找到撒

    ###### @红薯######用反向代理######

    引用来自“滔哥”的答案

    用反向代理


            location /koo_tools{
                    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;
                    proxy_pass   http://127.0.0.1:18080/koo_tools;


            }
    这是一段配置 我看起来也没什么问题的
    ###### http://www.ostools.net/apidocs/apidoc?api=nginx-zh######

    引用来自“滔哥”的答案

    http://www.oschina.net/code/snippet_12_21451

    看看红薯的这个文章,能不能对你找到撒

    换了一个tomcat 莫名其妙的又好了
    2020-06-01 13:38:13
    赞同 展开评论