Skip to content

Web panel 404 when behind nginx #25

@cm-360

Description

@cm-360

Describe the bug
When the web panel is hosted through a proxy server such as nginx, rather than port-forwarded directly, and is not accessible from the root of the web server, the panel's webpage fails to load completely because the required scripts are accessed in a non-relative fashion.

To Reproduce
Steps to reproduce the behavior:

  1. Start MCSS with the web panel configured as below.
  2. Start nginx with a proxy_pass directive configured in your server block for MCSS, for example:
server {
    ...
    # MCSS
    location /apps/mcss/ {
        proxy_pass http://[Private address displayed in web panel tab]:8833/;
    }
}
  1. Attempt to reach the web panel through nginx using the newly configured location.
  2. The page itself will load fine but the web panel will not because the GET requests for the necessary scripts fail.

Expected behavior
The links should be relative to account for setups like this and the panel should load as normal.

Screenshots
Web panel configuration in MCSS:
MCSS web panel config screenshot
Failed GET request for start-4288749f.js:
Screenshot 2022-08-27 203650
The 3 offending link elements in the received HTML:
Screenshot 2022-08-27 203712

Desktop:

  • OS: Windows 10 Pro 21H2-19044.1889
  • Browser: Firefox 104.0
  • MCSS Version: 13.0.4
  • nginx: 1.23.1

Additional context
When accessed through the appropriate local address, the web panel loads with no issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions