簡體   English   中英

如何使用Nginx proxy_pass

[英]How to use nginx proxy_pass

如何在proxy_pass中指定網址路徑。 以下是nginx conf文件

location / {
    proxy_pass http://www.example.com/
}

網址http://www.example.com/將動態重定向到http://www.example.com/image/file.aspx?img=1

如何指定一個內部重定向到另一個URL的URL。 任何幫助都會非常有幫助

試試nginx HttpRewriteModule,您不需要這些代理。 它遵循以下格式:

rewrite regex         replacement                              flag
   |      |                |                                    |
rewrite   ^/    http://www.example.com/image/file.aspx?img=1 permanent;

然后:

location / {

    rewrite ^/ http://www.example.com/image/file.aspx?img=1 permanent;

}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM