NGINX 使用代理传递将查询字符串参数传递给后端服务器

时间:2021-02-14 17:40:03

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

我有一个 HTML 页面。该页面包含一个按钮。点击按钮,控制权转移到NGINX,NGINX将转移请求发送到后端服务器。

<a onclick="onLinkClick(event)" href="/data/">data</a>

这是 nginx.conf 的样子:

location /data/{
                    proxy_pass http://myserver:9988/;
                     rewrite (.*)/$ $1/index.html last;
                       index index.html?usr=simpson; # how can I pass query string parameter ?
              }

每当页面打开时,我总是希望传递一个查询字符串参数。如何传递查询字符串参数?

0 个答案:

没有答案