I’m hosting a Node.js Wiki server (openKB) on /wiki
behind an Nginx server. How can I proxy_pass from Nginx while also having Nginx serve static assets hosted at /wiki/public
and /wiki/images
and /wiki/stylesheets/build
and so on.
What I had tried but did not work:
location /wiki {
proxy_pass http://127.0.0.1:4444;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
EDIT:
Site: dffrnt.com/wiki
Output: While the app runs just fine, the static assets are not getting served at all. I noticed some of the assets are 404 while some others are 503.
Here’s what’s on the server...