Home Installation and Configuration Configuring Valid HTTPS for FNM Manager

Configuring Valid HTTPS for FNM Manager

Last updated on Feb 12, 2025

Configuring Valid HTTPS for FNM Manager

FNM Manager runs on port 8081, which prevents changing the port directly to enable HTTPS on the main server. To solve this, it is recommended to set up a reverse proxy with Nginx, allowing the service to be exposed on port 443 with a valid SSL certificate.

Prerequisites

  1. Have Nginx installed on the server.

  2. Own a domain or subdomain pointing to the server's IP.

  3. Obtain a valid SSL certificate, such as using Let's Encrypt.

Installing Nginx

If you don't have Nginx installed, you can do so with the following command on Ubuntu-based system:

sudo apt update && sudo apt install nginx -y

Reverse Proxy Configuration

Edit or create a new configuration file at /etc/nginx/sites-available/fnm_manager:

server {
    listen 80;
    server_name your-domain.com;

    location / {
        return 301 https://$host$request_uri;
    }
}

server {
    listen 443 ssl;
    server_name your-domain.com;

    ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;

    location /adminer {
        proxy_pass https://127.0.0.1:8081/adminer/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
    }

    location /public {
        proxy_pass https://127.0.0.1:8081/public/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
    }
}

Activating the Configuration

  1. Create a symbolic link to enable the configuration:
sudo ln -s /etc/nginx/sites-available/fnm_manager /etc/nginx/sites-enabled/
  1. Verify the configuration:
sudo nginx -t
  1. Restart Nginx to apply the changes:
sudo systemctl restart nginx

Obtaining an SSL Certificate with Let's Encrypt

If you don't have an SSL certificate yet, you can generate one using Certbot:

sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d your-domain.com

Certbot will automatically configure the SSL certificate in Nginx.

Conclusion

With this configuration, FNM Manager will be securely accessible via HTTPS at the following routes:

This ensures a secure connection without modifying the service's original 8081 port.