nginx proxy_pass和页面中的URL

时间:2019-12-02 18:58:10

标签: nginx proxypass

我在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

任何想法或提示我该怎么做?

0 个答案:

没有答案