Report this

What is the reason for this report?

How come my reverse proxy subdir won't work for static content?

Posted on January 29, 2016

I have setup a reverse proxy as instructed in your guys’ tutorial on using a reverse proxy with node and nginx like so:

server {
        listen 80;
        server_name localhost;

        location / {
                proxy_pass http://127.0.0.1:3000;
                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 /forums {
                proxy_pass http://localhost:4567;
                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;
        }
}

Everything works on /

But when I try to go to /forums I get the page to load, but all the static content 404’s because its trying to load it from localhost/w.e instead of localhost/forums/w.e how might I fix this?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.