Answer the question
In order to leave comments, you need to log in
Why wrong file paths after nginx proxy?
I do proxying for one of the applications (there are 3 applications within one domain).
...
location /crm{
proxy_pass http://127.0.0.1:5000/;
}
...
/static/css/8.32345p.chunk.css
https://my.site/crm/static/css/2.3418215a.chunk.css
also fail Answer the question
In order to leave comments, you need to log in
Try this.
location /adminka/ {
rewrite ^/adminka/(.*)$ /$1 break;
proxy_pass http://127.0.0.1:5000/;
sub_filter 'src="/' 'src="/adminka/';
sub_filter 'action="/' 'action="/adminka/';
sub_filter 'href="/' 'href="/adminka/';
sub_filter_once off;
}
In order for the location url to fail to the proxied resource, it is enough to remove the final slash from the directive proxy_pass
.
As an option:
1. Make a symlink from where to where you need it 2. Don't forget to add
disable_symlinks off
to the nginx settings ;
This directive is supported in http, server, location
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question