Enable https and disable http or redirect to https

Hi All,

Is there have easy/cheap/simple way to enable https on librenms gui. I means whether totally disable http and just do https or when user do http then it wil redirect to https. Currently im accesss gui was through IP address. I already look below url but not work.

Appreciate any feedback

Hi, but what do you mean it doesn’t work?
The best way would be to redirect on the http server (e.g. nginx or apache) as mentioned in the link above.
Have you try this (assuming that you are using nginx):

server {
listen 80;
listen [::]:80;
server_name example-matches-LetsEncrpt.com;
return 301 https://$server_name$request_uri;
}

Hi @devhubpl ,

Which part that i need to change? I’m just use ip address only.

Thanks and appreciate your feedback

Assuming tha you are using nginx as http server and debian/ubuntu as your os, look at /etc/nginx/sites-enabled/
there should be conf file pointing to librenms location, ex

root /opt/librenms;

In this file you must change do redirect in server section (with listen 80;) as mention above, ex

server {
listen 80;
listen [::]:80;
server_name 192.168.0.22;
return 301 https://192.168.0.22$request_uri;
}

But remember that you must have server section for https (can be in this same file) with all nessesary options.
Search with google, nginx redirect http to https for more details.
The different story will be with certificate: self-signeg or from lets encrypt…

Hi @devhubpl ,

First of all i’m using ubuntu 22. I follow this url SSL for LibreNMS on Ubuntu 20.04 FULL How-to … But when i execute command " sudo add-apt-repository ppa:certbot/certbot" i get error as per below. Is it the “repo” different in ubuntu 22?

Hit:6 Index of /ondrej/php/ubuntu jammy InRelease
Err:7 Index of /certbot/certbot/ubuntu jammy Release
404 Not Found [IP: 185.125.190.80 443]
Reading package lists… Done
E: The repository ‘Index of /certbot/certbot/ubuntu jammy Release’ does not have a Release file.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.