【发布时间】:2015-09-21 14:39:29
【问题描述】:
是否可以在 Nginx 中使用 proxy_pass 删除查询字符串? 例如,我将我的 nginx 称为:
http://nginxproxy.com/api/v1/logout?session=123
并希望将其代理到:
http://example.com/api/sessions/?_action=logout
没有查询字符串“session=123”。
目前我的设置只是将我传递给 proxy_pass URL 的任何查询字符串添加。
location /api/v2/logout {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Session $arg_token;
proxy_pass http://example.com/api/sessions/?_action=logout;
}
【问题讨论】:
-
你发现了吗?
标签: nginx