assets not loading over reverse proxy (nginx)
See original GitHub issueFirst of all great work on this project. You are truly thought leaders.
I am trying to serve a single instance react-starter-kit app over a nginx reverse proxy on the path name /stories
- fe. the url would be http://localhost/stories
.
The app itself loads fine, but the assets via webpack do not load at http://localhost/stories/assets
. - where I need them to load.
Here is my nginx.conf:
worker_processes 4;
events { worker_connections 1024; }
http {
upstream home {
least_conn;
server home:3001 weight=10 max_fails=3 fail_timeout=30s;
}
upstream stories {
least_conn;
server stories:3001 weight=10 max_fails=3 fail_timeout=30s;
}
server {
listen 80;
location / {
proxy_pass http://home;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location /stories {
rewrite ^/stories(.*) /$1 break;
proxy_pass http://stories;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
NGINX Reverse proxy not loading resources
If I understand your problem correctly it sounds like the problem is your application thinks it's hosted at the root uri ...
Read more >Can't get nginx reverse proxy to load css/images of web ...
Your website's HTML is trying to access a url that is not /test/** but /platform/images/leaves.png this means that NGINX won't try to use ......
Read more >NGINX Reverse Proxy not loading some elements
I have set up an NGINX Reverse Proxy which is working fine and dandy for plex, my irrigation system, etc etc. It is...
Read more >Using nginx as reverse proxy and 404 assets problems
I'm using Nginx as reverse proxy but I have a problem with it. It's not serving any asset (JS, CSS, image, etc). When...
Read more >Nginx reverse proxy is working except static files (images ...
please check if www-data has the privileges to access your static assets.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think problem here is with
/
prefixing resources path. You must tweak public path in webpackI have the same issue
Access via nodejs
Access via nginx