Can't use parse dashboard through domain

I can’t load parse dashboard through domain, hosted in digitalocean vps - ubuntu 20.04
full (strict) ssl - cloudflare

dashboard is accessible through direct IP address access - “htt p://ipaddress:4040/login”

nginx - reverse proxy enabled for dashboard and server, reverse proxy working for parse server but failing on dashboard.
when i try to load “htt ps://mydomain.com/dashboard” - it redirects to “htt ps://mydomain.com/login” with 404 Not found page

nginx config on /etc/nginx/sites-enabled/domain.com

# HTTP - redirect all requests to HTTPS
server {
    listen 80;
    listen [::]:80 default_server ipv6only=on;
    return 301 https://$host$request_uri;
}
# HTTPS - proxy requests to /parse-server/
# through to Parse Server
server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    ssl_certificate         /etc/ssl/cert.pem;
    ssl_certificate_key     /etc/ssl/key.pem;
    ssl_client_certificate /etc/ssl/cloudflare.crt;
    ssl_verify_client on;
    server_name domain.com www.domain.com;
    root /usr/share/nginx/html;
    index index.html index.htm index.nginx-debian.html;

  # Pass requests for /parse/ to Parse Server instance at localhost:1337
    location /parse-app/ {
         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_pass http://localhost:1337/app/;
         proxy_ssl_session_reuse off;
         proxy_set_header Host $http_host;
         proxy_redirect off;
    }

    location /dashboard/ {
         proxy_pass http://localhost:4040/dashboard/;
         proxy_set_header Host $host;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header X-Forwarded-Proto https;
     }
}

parse server json

{
  "appName": "AppName",
  "databaseURI": "mongodb://localhost:27017/app",
  "appId": "DJFKASJFI3S8DSJFDH",
  "masterKey": "823JKHR87SDFJSDHF8DFHASFDF",
  "serverURL": "http://localhost:1337/app/",
  "publicServerURL": "https://domain/parse-app/",
  "port": 1337,
  "mountPath": "/app"
}

dashboard config json

{
  "apps": [
    {
      "serverURL": "http://ipaddress:1337/app",
      "appId": "DJFKASJFI3S8DSJFDH",
      "masterKey": "823JKHR87SDFJSDHF8DFHASFDF",
      "allowInsecureHTTP": "true",
      "appName": "appname"
    }
  ],
"users": [
    {
      "user":"adminapp@4421",
      "pass":"appoadmin@4444#"
    }
  ],
  "iconsFolder": "icons"
}

parse server is working through both domain and direct ipaddress:1337

parse dashboard is only available through ipaddress:4040 and it’s working fine
when i try to access using https://domain/dashboard/ it is redirected to https://domainname.com/login and showing a 404 page

1337, 4040 ports are open

Try to add the env var MOUNT_PATH with value /dashboard/

added in dashboard_config.json

"mountPath":/dashboard"

also tried with

"port": 4040

  location /dashboard/ {
        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_pass http://localhost:4040/dashboard/;
        proxy_ssl_session_reuse off;
        proxy_set_header Host $http_host;
        proxy_redirect off;
     }

still the same results. I’m pulling my hair …:frowning:
its driving me crazy for past 3 days.

MOUNT_PATH needs to be an env var

I’m sorry to bother you again, I’m a newbie in backend and server management, I really don’t understand what you meant by

MOUNT_PATH needs to be an env var

I used JSON to config parse and used nohup to run the server.

it is redirecting to https://domain.com/login (404 not found) when I enter https://domain.com/dashboard i really don’t under stand why its happening.
It will be really helpful if you can point me to the right direction.
Thank you

How are you starting parse dashboard?

Hi, Is there any suggestion to resolve this issue

nohup parse-dashboard --dev --config  ~/parsesample/config_parsesample_dashboard.json &

Just an idea:
Try changing this statement in Nginx’s config:
proxy_pass http://localhost:4040/dashboard/;
To this:
proxy_pass http://localhost:4040/;

Then restart Nginx and try accessing your dashboard again.

You can also try nohup MOUNT_PATH='/dashboard/' parse-dashboard --dev --config ~/parsesample/config_parsesample_dashboard.json &

@Sarun1001 Have you found any solution to this ? I don’t know what should I do I have same problem