I’m trying to host cockpit and a node.js server on the same production server. I’m using Nginx to dispatch the access to the two servers based on the requested url.
The idea is that for any url I’d want to forward the traffic to the node.js server exposed on localhost:3000.
Instead I’d like to forward all the urls starting with ‘cms’ or ‘cockpit’ or any other differentiator to cockpit cms exposed on localhost:8080.
So I’m trying a way to change the cockpit entry point for all its paths. For example:
localhost:8080/auth/login should be localhost:8080/cockpit/auth/login
localhost:8080/collections should be localhost:8080/cockpit/collections
in this way I can tell Nginx to forward any traffic to cockpit cms based on if the url starts with cockpit.
This worked for me on Docker setup by modifying defines.php, some of assets are still generated with wrong path, because of that settings are infinitely loading.
I think it would be great to have something like ROOT_URL or URL_PREFIX in cockpit config.php file which would add url prefix for all of the routes simplifying reverse proxy setup.
One of the workarounds would be to use sobdomains on nginx instead of folders.
codemirror.js file is getting included in script tag as /cms/assets/…/codemirror.js it causes the issue.