我有a.b域(例如)并希望username.github.io/project在a.b/c. 这意味着我还想将我的浏览器 url 保留a.b/c为username.github.io/project.
我在 nginx 模块中有以下设置
location /c {
proxy_pass http://username.github.io/project;
proxy_redirect http://username.github.io http://a.b;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
}
Run Code Online (Sandbox Code Playgroud)
如果我更改proxy_set_header Host $http_host为proxy_set_header Host $proxy_hostor $host,它只是重定向到http://username.github.io/project我不想要的。我能怎么做?