Thanks to visit codestin.com
Credit goes to github.com

Skip to content

proxy_pass 转发的问题 #46

@Tzxhy

Description

@Tzxhy

贴个配置如下:

domain www.tanzhixuan2018.top {
    location / {
        proxy_pass http://$ip/;
    }
    location /to {
        proxy_set_header Host hiproxy.org; # [conf1]
        proxy_pass http://hiproxy.org/zh-cn/get_started/cli_options.html;
    }

    location /login {
        proxy_pass https://$ip/qfc-pm/login/;
        proxy_set_header from 'hiproxy';
        set_header proxy 'hiproxy';
    }
}

如上述代码,在 [conf1] 注释的情况下,代理会默认使用源请求的Host,导致访问目的服务器时仍然带着源请求的Host,致使访问失败。现在只能手动设置Host。

望添加根据proxy_pass 自动添加代理Host的功能。谢谢。

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions