Linux使用xshell配合nginx代理打隧道代理到本地端口

266 阅读1分钟
#/connection/*  请求,都会代理到本地

        location /connection/ {
            proxy_pass http://localhost:28098/connection/;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }

1.在nginx.conf中增加以上配置;

2.服务器属性配置

    /**
     *
     * @return
     */
    @GetMapping({"/connection/google"})
    public String google(TestData testData) {
        System.out.println(testData);
        return "redirect:https://wwww.demo.com/connection/redirect";
    }

    /**
     *
     * @return
     */
    @GetMapping({"/connection/redirect"})
    public String redirect(TestData testData) {
        System.out.println(testData);
        return THEME + "/index";
    }

这样在浏览器输入连接就能debug进入本地进行调试