WEIGEL FORUM
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Login

    QuickGuide: NGINX Reverse Proxy with HTTPS

    Linux
    1
    1
    4
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DerMeldosD
      DerMeldos
      last edited by

      1. Install Nginx
        On Ubuntu/Debian:
      sudo apt update
      sudo apt install nginx
      
      1. Configure Reverse Proxy
        Create a new file:
        /etc/nginx/sites-available/uptime
      server {
          listen 80;
          server_name uptime.ricardoweigel.de;
      
          location / {
              proxy_pass http://127.0.0.1:3001;
              proxy_set_header Host $host;
              proxy_set_header X-Real-IP $remote_addr;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          }
      }
      

      Enable the config:

      sudo ln -s /etc/nginx/sites-available/uptime /etc/nginx/sites-enabled/
      sudo nginx -t
      sudo systemctl reload nginx
      

      Now, visiting http://uptime.ricardoweigel.de will show your service running on port 3001 without exposing the port.

      1. Add HTTPS with Let's Encrypt
        Use Certbot:
      sudo apt install certbot python3-certbot-nginx
      sudo certbot --nginx -d uptime.ricardoweigel.de
      

      It will automatically edit your config to redirect HTTP to HTTPS.

      Result:
      Users go to: https://uptime.ricardoweigel.de
      Internally forwarded to: http://127.0.0.1:3001
      Clean, professional, and secure.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Powered by NodeBB | Contributors