I am trying to host my website and CMS on the same Ubuntu server and am trying to access them both, but I am struggling with the configuration. The website is currently a simple HTML page, and the CMS is a Node app. The CMS app has an index page on http://localhost:1337/
and a dashboard page on http://localhost:1337/admin
. With my current setup I can only view the index page on WEBSITE.eu/admin
. When I try to go to WEBSITE.eu/admin/admin
it is unable to find the static files (json / js files, etc.) to render the page.
So in short what I want to do is: WEBSITE.eu/admin
location to point to http://localhost:1337/admin
so the CMS dashboard is shown.
My current server block config
server {
listen 80;
listen [::]:80;
root /var/www/WEBSITE/html;
index index.html index.htm;
server_name WEBSITE.eu www.WEBSITE.eu;
location /admin {
proxy_pass http://localhost:1337/admin/;
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;
}
}
Thanks in advance.