第页中的nginx proxy_pass和URL
我对nginx中的proxy_pass有问题。我有一个页面,比如test.com。在test.com/article中,我使用proxy\u pass:第页中的nginx proxy_pass和URL,nginx,proxypass,Nginx,Proxypass,我对nginx中的proxy_pass有问题。我有一个页面,比如test.com。在test.com/article中,我使用proxy\u pass: server { listen 80; server_name test.pl; root /var/www/html/test.com; index index.html; try_files $uri /index.html;
server {
listen 80;
server_name test.pl;
root /var/www/html/test.com;
index index.html;
try_files $uri /index.html;
location /article/ {
proxy_pass https://anotherpage.com/;
}
}
这是可行的,但如果我在test.com/article页面上有链接,它们看起来像:test.com/some-link
我希望它是:test.com/article/some-link
有什么想法或提示吗?我该怎么做?你应该自己生成链接。真的不清楚你到底是什么意思…@emix好的,所以我试着解释一下。我有两个网站。我希望在第一个站点中有第二个站点:test.com/help=anotherpage.com(因此第一个页面包含第二个页面:)),但当我在test.com/help中有链接时(由于proxy_pass,它是anotherpage.com),它们直接指向test.com/some-link,而不是test.com/help/some-link