Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with uppercase characters in base path #6564

Open
zpuskaric opened this issue Nov 27, 2024 · 2 comments
Open

Problem with uppercase characters in base path #6564

zpuskaric opened this issue Nov 27, 2024 · 2 comments
Labels

Comments

@zpuskaric
Copy link

zpuskaric commented Nov 27, 2024

Bug (or feature) description:
I decided to put MeshCentral behind nginx reverse proxy and under non-root base path like:

https://myhost.mydomain.org/AaBbCc

in nginx I was passing location:

location /AbBcC {
        proxy_pass http://127.0.0.1:4443/AaBbCc
        proxy_http_version 1.1;
        proxy_hide_header content-security-policy;      
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        # Inform MeshCentral about the real host, port and protocol
        proxy_set_header X-Forwarded-Host $host:$server_port;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
}

in MeshCentral config.json i had:

  "domains": {
    "": {
      "_title": "MyServer",
      "_title2": "Servername",
      "_minify": true,
      "_newAccounts": true,
      "_userNameIsEmail": true
    },
    "AaBbCc": {
      "title": "MC Server",
      "title2": "mine",
      "minify": true,
      "newAccounts": false,
      "userNameIsEmail": false,
      "certUrl": "https://127.0.0.1:443/"
    }

I would get login screen but after logging I would get error 404.

Steps to reproduce:

put uppercase characters in base path in nginx config file (in this case AaBbCc)

Expected behavior:

To log into Meshcentral domain

Resolution:

After some time I noticed that returned URL converted all characters to lowercase and the request would not pass nginx.

After changing all AaBbCc paths to aabbcc in nginx and Meshcentral config files everything would work as expected.

Might help someone saving some time and head scratching.

@zpuskaric zpuskaric added the bug label Nov 27, 2024
@zpuskaric
Copy link
Author

Correction:

location /aAbBcC should be location /AaBbCc

@si458
Copy link
Collaborator

si458 commented Nov 27, 2024

fixed your formatting for you
this is an nginx issue and not a meshcentral issue
you should be using proxy_pass http://127.0.0.1:4443/ from what im aware
because it will pass /AaBbCc to the backend when you visit it anyways

@si458 si458 added question and removed bug labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants