【问题标题】:How to make nginx proxy according to url parameters?如何根据url参数制作nginx代理?
【发布时间】:2019-03-04 17:40:24
【问题描述】:

我想根据url参数做nginx代理

网址示例: www.foo.com/proxy/$serverUrl/$picUrl

$serverUrl 示例:storage.example.com $picUrl 示例:test.jpg 或 test.png

代理到: https://$serverUrl/static/$picUrl

如何制作这样的 nginx 代理?

【问题讨论】:

    标签: nginx proxy nginx-location proxypass nginx-config


    【解决方案1】:
    location ~ /proxy/(.*)/(.*)$ {
        proxy_pass https://$1/static/$2;
    }
    

    试试吧,希望对你有帮助

    【讨论】:

      猜你喜欢
      • 2019-03-14
      • 2016-05-28
      • 2021-10-27
      • 1970-01-01
      • 2014-07-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-08
      相关资源
      最近更新 更多