Reputation: 2891
The following configuration will rewrite /admin
while proxy_pass /core
, I can't figure out the reason. Any hint on this? Similar case like this Nginx: location regex for multiple paths with backend .
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /\#$1 break;
}
}
location ~ ^/(admin|core)/ {
proxy_pass http://127.0.0.1:8080/$1;
}
Upvotes: 0
Views: 820
Reputation: 10304
Using try_files
will simplify things.
location /
try_files $uri $uri/ =404;
}
location ~ ^/(?:admin|core)/ {
proxy_pass http://127.0.0.1:8080;
}
Upvotes: 1
Reputation: 2675
Try this variant:
location ~ ^/(admin|core)(.*)$ {
proxy_pass http://127.0.0.1:8080/$1;
}
Upvotes: 0