Reverse Proxy Help/Documentation Conflict

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 in html/.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?

change .htaccess

I’m glad to hear that I’m not doing something wrong :slight_smile:

Will this break updates if there’s a git commit that changes that file?

The project tries not to change that file because many people use subdirectories…
I personally prefer using sub-domains, much cleaner.

Depending on your DNS and Certificate setup that could certainly be the case.

Thanks so much for the quick response!

Let’s Encrypt for the win :wink: