更新时间:2022-05-12 06:15:19
要分配域/路径时,是否应该始终修改应用程序?
Should you always modify the application when you want to assign a domain/path?
不,您根本不需要修改应用程序.
No, you shouldn't have to modify the application at all.
以这种方式使用proxy_pass
时,需要用正则表达式重写URL.尝试这样的事情:
When you use proxy_pass
in this manner, you need to rewrite the URL with regex. Try something like this:
location ~ ^/app1/(.*)$ {
proxy_pass http://localhost:8080/$1$is_args$args;
}