Our librenms server only has librenms and nginx. nginx only proxies the librenms application on root /
But from a reverse proxy (also nginx) how can i serve the librenms application?
We have several web applications and are able to serve them through said reverse proxy, if and only if they are in a subdirectory. I have issues when the web app is on root / (ie librenms)
Works fine accessing librenms directly:
https://librenms-lab/
but from the reverse proxy which should serve the above app
I was also trying to run librenms on a subdirectory and also trying to use a reverse proxy to access librenms
Basically you would be able to access librenms directly or through the reverse proxy.
BUT
At least with the success i’ve been having, i have been able to get some apps to work only when run on a subdirectory. So that’s why i was asking about running librenms on a subdirectory.
I don’t know if things changed from 2018, but no matter what I try librenms always redirects to the root. I have
$config['base_url']='/librenms'
in config.php
and
APP_URL=/librenms/
in .env, but:
curl -v -s -o /dev/null http://localhost:83
* Expire in 0 ms for 6 (transfer 0x55e0caba6e80)
* Expire in 1 ms for 1 (transfer 0x55e0caba6e80)
* Expire in 0 ms for 1 (transfer 0x55e0caba6e80)
* Expire in 1 ms for 1 (transfer 0x55e0caba6e80)
* Expire in 0 ms for 1 (transfer 0x55e0caba6e80)
* Expire in 0 ms for 1 (transfer 0x55e0caba6e80)
* Expire in 2 ms for 1 (transfer 0x55e0caba6e80)
* Expire in 0 ms for 1 (transfer 0x55e0caba6e80)
* Expire in 0 ms for 1 (transfer 0x55e0caba6e80)
* Expire in 2 ms for 1 (transfer 0x55e0caba6e80)
* Expire in 0 ms for 1 (transfer 0x55e0caba6e80)
* Expire in 0 ms for 1 (transfer 0x55e0caba6e80)
* Expire in 2 ms for 1 (transfer 0x55e0caba6e80)
* Expire in 0 ms for 1 (transfer 0x55e0caba6e80)
* Expire in 0 ms for 1 (transfer 0x55e0caba6e80)
* Expire in 2 ms for 1 (transfer 0x55e0caba6e80)
* Expire in 0 ms for 1 (transfer 0x55e0caba6e80)
* Expire in 0 ms for 1 (transfer 0x55e0caba6e80)
* Expire in 2 ms for 1 (transfer 0x55e0caba6e80)
* Expire in 1 ms for 1 (transfer 0x55e0caba6e80)
* Expire in 1 ms for 1 (transfer 0x55e0caba6e80)
* Expire in 1 ms for 1 (transfer 0x55e0caba6e80)
* Trying ::1...
* TCP_NODELAY set
* Expire in 149998 ms for 3 (transfer 0x55e0caba6e80)
* Expire in 200 ms for 4 (transfer 0x55e0caba6e80)
* connect to ::1 port 83 failed: S’ha refusat la connexió
* Trying 127.0.0.1...
* TCP_NODELAY set
* Expire in 149998 ms for 3 (transfer 0x55e0caba6e80)
* Connected to localhost (127.0.0.1) port 83 (#0)
> GET / HTTP/1.1
> Host: localhost:83
> User-Agent: curl/7.64.0
> Accept: */*
>
< HTTP/1.1 302 Found
< Server: nginx/1.14.2
< Content-Type: text/html; charset=UTF-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Cache-Control: no-cache, private
< Date: Fri, 08 May 2020 08:13:14 GMT
< Location: https://localhost:83/login
< Set-Cookie: XSRF-TOKEN=eyJpdiI6IlF2cTJRNXdiZ25DeTV6T21sMGxWQnc9PSIsInZhbHVlIjoiUElGeG9vTEVuNnUxV0dIQ3JBY0tiSStCUDZKZ3ZjWUtyWFRsNWV0Y3dFQmo3bEY5UUFEVDJxcDZGVUxDY2JqRiIsIm1hYyI6ImU0MmQ2N2U4M2ZhN2JmOGNlOTU3MmQwZDFjNzI0NTVkMGU0MDBjZjJiMTVhZWNkNzk3YjNiODk0YWYzYjUzZDAifQ%3D%3D; expires=Fri, 08-May-2020 10:13:14 GMT; Max-Age=7200; path=/
< Set-Cookie: laravel_session=eyJpdiI6Ik9cL0RLMmEreDd1UGtRTTFqelVYeXhRPT0iLCJ2YWx1ZSI6IjU5MkpFVVByMHU2V3lkbTRxcUh1MXZlVEFpQ2RMdXl1Mk1RUUNKbGZUbVArWEdZd1F4QjBkeVRuNlwvcXJlZ0M2IiwibWFjIjoiZTgyYzNhNWRlODhkYmYzNTA3NGFkMjY5ODgyMTRhMWVkYjE0YTY3MDliMmY2MTNjMzg1MzNmNTkyNDA3YTcxMyJ9; expires=Fri, 08-May-2020 10:13:14 GMT; Max-Age=7200; path=/; httponly
<
{ [362 bytes data]
* Connection #0 to host localhost left intact