服务器编号1接收http://server111.com/box_example/?boo=test&too=best
之类的请求,并将代理重写请求(如http://server222.com/u=box_example&?boo=test&too=best
)接收到服务器编号2
我在这里尝试的是选择:
location ~*/ {
rewrite ^/([a-z0-9])$ u=box_example&?boo=test&too=best break;
rewrite ^/(~*[a-z0-9])$ u=box_example&?boo=test&too=best break;
...
proxy_pass http://192.168.200.9:3000;
请告诉我怎么做。
答案 0 :(得分:0)
试试这个:
location / {
rewrite ^/(.*)/$ /?u=$1&$args break;
...
proxy_pass http://192.168.200.9:3000;