2017-12-18 217 views
0

訪問/abc/sitemap.xml時我想顯示/abc/sitemap?output=xml的內容而不更改網址NGINX在不改變url的情況下改寫位置

目前,它顯示正確的內容,但將網址更改爲/ abc/sitemap?output = xml,而不是保留/abc/sitemap.xml,這裏是我的配置。

location /abc/sitemap.xml { 
    rewrite^/abc/sitemap?output=xml; 
} 

感謝

回答

0

怎麼樣proxy_pass

location /abc/sitemap.xml { 
    proxy_pass http://$host/abc/sitemap?output=xml; 
} 

注:使用HTTPHTTPS根據您的SSL配置。

相關問題