Is there any way do a revese proxy uptime kuma for a nginx on a subdirectory?

1.1k Views Asked by At

I am using uptime kuma in a docker container, and with a docker-compose I also have nginx here are my configurations

upstream kuma {
    server kuma:3001;
}

location ~/kuma(.*)$ {
    proxy_set_header X-Real-IP  $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header Host $host;
    proxy_pass http://kuma$1;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
}

when go to http://localhost/kuma I get 404 on http://localhost/assets/index-ba0179be.js, is obvious because it should go to http://localhost/kuma/assets/index-ba0179be.js.

But I don't know how should I do that.

1

There are 1 best solutions below

0
On BEST ANSWER

Unfortunately it is not yet supported, according to the docs

Uptime Kuma does not support a subdirectory such as http://example.com/uptimekuma. Please prepare a domain or sub-domain to do that.

https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy