Replies: 4 comments
-
does this help? |
Beta Was this translation helpful? Give feedback.
-
As far as I can see the base_url handing is totally broken.
As a work around I've found these two NGINX options for proxy_pass will make it work. This passes the host header and correct protocol to librenms in the container, allowing it to successfully build the URLs correctly.
|
Beta Was this translation helpful? Give feedback.
-
I had the same experience, first discovered when visiting I came up with a couple of ugly workarounds but decided against them because having a |
Beta Was this translation helpful? Give feedback.
-
LibreNMS in a subdirectory does not work very well because there is a mix of modern and legacy code interacting with URLs. This is an upstream bug, if you have the will to work on it there, I think a lot of people would appreciate it. I suggest using a subdomain ala librenms.domain.com instead if you can. |
Beta Was this translation helpful? Give feedback.
-
Behaviour
I want to use Librenms with nginx reversy proxy, but the redirection does not work properly.
Steps to reproduce this issue
docker run -d -p 8000:8000 --name librenms --network test --cap-add=NET_ADMIN --cap-add=NET_RAW -e "LIBRENMS_BASE_URL=/librenms/" -e "DB_HOST=mysql" -e "DB_PASSWORD=mysql" -e "DB_USER=root" librenms/librenms:latest
docker run -d --name nginx -p 80:80 --network test nginx
Expected behaviour
Nginx proxies requests for the virtual path
Actual behaviour
The HOST/librenms request forwarded to the librenms container. Then the container redirects it to HOST/login page. This page obviously does not exist, the correct path would be HOST/librenms/login.
Configuration
I tested this behaviour with multiple nginx and docker configurations.
docker --version
) : Docker version 20.10.5, build 55c4c88966uname -a
) : 5.11.10-arch1-1 can not connect to librenms gui - 404 page not found #1 SMP PREEMPT Fri, 26 Mar 2021 00:11:29 +0000 x86_64 GNU/Linuxdocker-compose.yml
,.env
, ...I tried it with many nginx configurations, i think this one should work (/etc/nginx/conf.d/default.conf contents):
Docker info
Logs
Beta Was this translation helpful? Give feedback.
All reactions