我有这个url:
http://localhost:8888/images/upload/root/folderA/folderB?arg1=A&arg2=B
所以,我想redirect到:
http://localhost:8080/v1/files_upload/
它一定是这样的:
http://localhost:8080/v1/files_upload/root/folderA/folderB?arg1=A&arg2=B
我有以下几点:
location ~ ^/images/upload/([^/]+)(/.*)\?(.*)$ { upload_pass @after_upload; ... ... } location @after_upload { proxy_pass http://localhost:8080/v1/files_put/$1/$2?$3; }
我检查了它,只工作$ 1和$ 2 ,但参数$ 3不发送到proxy_pass
提前致谢!
location
指令不匹配请求参数,它只检查请求路径。 你应该使用$args
变量(或者更具体的$arg_arg1
和$arg_arg2
):
location @after_upload { proxy_pass http://localhost:8080/v1/files_put/$1/$2?$args; }