我在nginx中的proxy_pass有问题。我只有一页,例如test.com。在test.com/article中,我使用proxy_pass:
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
任何想法或技巧,我该怎么做?
删除斜杠:
location /article {
proxy_pass https://anotherpage.com;
}