Reverse proxy + npm [Jul 17]

:raising_hand_man: sph asked

trying to set up nocodb (npm) behind a proxy (nginx)

```shell

NC_PUBLIC_URL=https://my.domain.tld/noco

NC_BACKEND_URL=http://127.0.0.1:9001

NC_DASHBOARD_URL=/noco/dashboard

```

```nginx

location /noco/ {

if ($scheme != “https”) {

return 301 https://$server_name$request_uri;

}

proxy_set_header X-Forwarded-For $remote_addr;

proxy_set_header X-Forwarded-Proto ‘https’;

proxy_set_header Host $host;

proxy_pass http://10.23.2.5:9001/;

}

```

all I get is Cannot GET /dashboard and GET /dashboard 404 148 - 2.708 ms in the npm log

what am I doing wrong?

:raising_hand_man: sph replied

hmm, it does work with portforward over ssh

:raising_hand_man: sph replied

managed to get it working with proxy_pass http://10.23.2.5:9001/noco/

api urls won’t work this way :confused:

:raising_hand_man: sph replied

```nginx

location ^~ /noco/dashboard {

if ($scheme != “https”) {

return 301 https://$server_name$request_uri;

}

proxy_set_header X-Forwarded-For $remote_addr;

proxy_set_header X-Forwarded-Proto ‘https’;

proxy_set_header Host $host;

proxy_pass http://10.23.2.5:9001/;

rewrite /noco(.*) $1 break;

}

location ^~ /noco/ {

if ($scheme != “https”) {

return 301 https://$server_name$request_uri;

}

proxy_set_header X-Forwarded-For $remote_addr;

proxy_set_header X-Forwarded-Proto ‘https’;

proxy_set_header Host $host;

proxy_pass http://10.23.2.5:9001/;

}

```

that’s one unholy piece of kludge but it works

NC_DASHBOARD_URL=/dashboard

Autogenerated from discord


Join NocoDB’s community

DiscordTwitterRedditDocs