I was having trouble getting a reverse proxy to work, the main issue seemed to be that I wanted it at www.example.com/librenms/ and not at the root.
I followed the FAQ section for “My reverse proxy is not working” by verifying that I was passing the correct headers, configuring the proxy as a trusted proxy, and setting $config['base_url']
and APP_URL, but it still didn’t work.
config.php:
$config["base_url"] = 'https://www.example.com/librenms/';
.env:
APP_TRUSTED_PROXIES=192.168.1.30
APP_URL=https://www.example.com/librenms/
What did work was changing the native librenms url following this: Sub-directory Support - LibreNMS Docs but there seems to be some conflicting advice there. That document says:
The
RewriteBase
directive inhtml/.htaccess
must be rewritten to reference the subdirectory name.
but html/.htaccess
says:
DO NOT CHANGE THIS FILE
If you need to change this file, you are doing something wrong.
It only seems to work if I change the file. What should I do?