location ~ ^/pages/\d+_index.json{ proxy_pass /pages/index.json; }
I tried it but it didn’t workI’m not familiar with nginx configuration, please ask for advice.
欢迎选择我的课程,让我们一起见证您的进步~~
You can use rewrite to rewrite your request path
location / { rewrite ^/pages/\d+_index\.json /pages/index.json break; proxy_pass http://127.0.0.1:8080; } # 测试下 会返回重写后的 url /pages/index.json location = /pages/index.json { return 200 $request_uri; }
I found two solutionsrewrite:
location ~ ^/pages/{ rewrite ^/pages/(\d+)/\d+_index.json http://$host/pages//index.json break; }
proxy_pass
location ~ ^/pages/(\d+)/\d+_index.json$ { proxy_pass http://$host/pages//index.json; }
You can use rewrite to rewrite your request path
I found two solutions
rewrite:
proxy_pass