$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update
-weight: 600;">sudo -weight: 500;">apt -weight: 500;">upgrade -y
-weight: 600;">sudo -weight: 500;">apt -weight: 500;">install -y nginx
-weight: 600;">sudo -weight: 500;">apt -weight: 500;">update
-weight: 600;">sudo -weight: 500;">apt -weight: 500;">upgrade -y
-weight: 600;">sudo -weight: 500;">apt -weight: 500;">install -y nginx
-weight: 600;">sudo -weight: 500;">apt -weight: 500;">update
-weight: 600;">sudo -weight: 500;">apt -weight: 500;">upgrade -y
-weight: 600;">sudo -weight: 500;">apt -weight: 500;">install -y nginx
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start nginx
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable nginx
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start nginx
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable nginx
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start nginx
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable nginx
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">status nginx
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">status nginx
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">status nginx
-weight: 600;">sudo -weight: 500;">apt -weight: 500;">install -y certbot python3-certbot-nginx
-weight: 600;">sudo -weight: 500;">apt -weight: 500;">install -y certbot python3-certbot-nginx
-weight: 600;">sudo -weight: 500;">apt -weight: 500;">install -y certbot python3-certbot-nginx
certbot --version
certbot --version
certbot --version
-weight: 600;">sudo nano /etc/nginx/sites-available/default
-weight: 600;">sudo nano /etc/nginx/sites-available/default
-weight: 600;">sudo nano /etc/nginx/sites-available/default
upstream backend_service { server localhost:3000; keepalive 32;
} server { listen 80; listen [::]:80; server_name api.example.com; location / { proxy_pass http://backend_service; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection '-weight: 500;">upgrade'; 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 $scheme; proxy_cache_bypass $http_upgrade; proxy_redirect off; }
}
upstream backend_service { server localhost:3000; keepalive 32;
} server { listen 80; listen [::]:80; server_name api.example.com; location / { proxy_pass http://backend_service; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection '-weight: 500;">upgrade'; 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 $scheme; proxy_cache_bypass $http_upgrade; proxy_redirect off; }
}
upstream backend_service { server localhost:3000; keepalive 32;
} server { listen 80; listen [::]:80; server_name api.example.com; location / { proxy_pass http://backend_service; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection '-weight: 500;">upgrade'; 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 $scheme; proxy_cache_bypass $http_upgrade; proxy_redirect off; }
}
-weight: 600;">sudo nginx -t
-weight: 600;">sudo nginx -t
-weight: 600;">sudo nginx -t
-weight: 600;">sudo -weight: 500;">systemctl reload nginx
-weight: 600;">sudo -weight: 500;">systemctl reload nginx
-weight: 600;">sudo -weight: 500;">systemctl reload nginx
-weight: 600;">sudo certbot --nginx -d api.example.com
-weight: 600;">sudo certbot --nginx -d api.example.com
-weight: 600;">sudo certbot --nginx -d api.example.com
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, unless you have a specific reason otherwise.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, unless you have a specific reason otherwise.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, unless you have a specific reason otherwise.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-weight: 600;">sudo cat /etc/nginx/sites-available/default
-weight: 600;">sudo cat /etc/nginx/sites-available/default
-weight: 600;">sudo cat /etc/nginx/sites-available/default
upstream backend_service { server localhost:3000; keepalive 32;
} server { listen 80; listen [::]:80; server_name api.example.com; return 301 https://$server_name$request_uri;
} server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name api.example.com; ssl_certificate /etc/letsencrypt/live/api.example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/api.example.com/privkey.pem; include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; location / { proxy_pass http://backend_service; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection '-weight: 500;">upgrade'; 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 $scheme; proxy_cache_bypass $http_upgrade; proxy_redirect off; }
}
upstream backend_service { server localhost:3000; keepalive 32;
} server { listen 80; listen [::]:80; server_name api.example.com; return 301 https://$server_name$request_uri;
} server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name api.example.com; ssl_certificate /etc/letsencrypt/live/api.example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/api.example.com/privkey.pem; include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; location / { proxy_pass http://backend_service; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection '-weight: 500;">upgrade'; 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 $scheme; proxy_cache_bypass $http_upgrade; proxy_redirect off; }
}
upstream backend_service { server localhost:3000; keepalive 32;
} server { listen 80; listen [::]:80; server_name api.example.com; return 301 https://$server_name$request_uri;
} server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name api.example.com; ssl_certificate /etc/letsencrypt/live/api.example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/api.example.com/privkey.pem; include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; location / { proxy_pass http://backend_service; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection '-weight: 500;">upgrade'; 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 $scheme; proxy_cache_bypass $http_upgrade; proxy_redirect off; }
}
-weight: 600;">sudo nginx -t
-weight: 600;">sudo nginx -t
-weight: 600;">sudo nginx -t
-weight: 600;">sudo -weight: 500;">systemctl reload nginx
-weight: 600;">sudo -weight: 500;">systemctl reload nginx
-weight: 600;">sudo -weight: 500;">systemctl reload nginx
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">status certbot.timer
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">status certbot.timer
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">status certbot.timer
-weight: 600;">sudo nano /etc/nginx/sites-available/default
-weight: 600;">sudo nano /etc/nginx/sites-available/default
-weight: 600;">sudo nano /etc/nginx/sites-available/default
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
limit_req_zone $binary_remote_addr zone=general:10m rate=10r/s;
limit_req_zone $binary_remote_addr zone=login:10m rate=5r/m;
limit_req_zone $binary_remote_addr zone=general:10m rate=10r/s;
limit_req_zone $binary_remote_addr zone=login:10m rate=5r/m;
limit_req_zone $binary_remote_addr zone=general:10m rate=10r/s;
limit_req_zone $binary_remote_addr zone=login:10m rate=5r/m;
limit_req zone=general burst=20 nodelay;
limit_req zone=general burst=20 nodelay;
limit_req zone=general burst=20 nodelay;
location ~ /\. { deny all; access_log off; log_not_found off;
} location ~ ~$ { deny all; access_log off; log_not_found off;
}
location ~ /\. { deny all; access_log off; log_not_found off;
} location ~ ~$ { deny all; access_log off; log_not_found off;
}
location ~ /\. { deny all; access_log off; log_not_found off;
} location ~ ~$ { deny all; access_log off; log_not_found off;
}
gzip on;
gzip_vary on;
gzip_min_length 1000;
gzip_types text/plain text/css text/xml text/javascript application/json application/javascript application/xml+rss;
gzip_disable "MSIE [1-6]\.";
gzip on;
gzip_vary on;
gzip_min_length 1000;
gzip_types text/plain text/css text/xml text/javascript application/json application/javascript application/xml+rss;
gzip_disable "MSIE [1-6]\.";
gzip on;
gzip_vary on;
gzip_min_length 1000;
gzip_types text/plain text/css text/xml text/javascript application/json application/javascript application/xml+rss;
gzip_disable "MSIE [1-6]\.";
-weight: 600;">sudo nginx -t
-weight: 600;">sudo -weight: 500;">systemctl reload nginx
-weight: 600;">sudo nginx -t
-weight: 600;">sudo -weight: 500;">systemctl reload nginx
-weight: 600;">sudo nginx -t
-weight: 600;">sudo -weight: 500;">systemctl reload nginx
-weight: 600;">sudo nano /etc/nginx/sites-available/default
-weight: 600;">sudo nano /etc/nginx/sites-available/default
-weight: 600;">sudo nano /etc/nginx/sites-available/default
upstream api_backend { server localhost:3000; keepalive 32;
} upstream app_backend { server localhost:5000; keepalive 32;
} server { listen 80; listen [::]:80; server_name api.example.com app.example.com; return 301 https://$server_name$request_uri;
} server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name api.example.com; ssl_certificate /etc/letsencrypt/live
upstream api_backend { server localhost:3000; keepalive 32;
} upstream app_backend { server localhost:5000; keepalive 32;
} server { listen 80; listen [::]:80; server_name api.example.com app.example.com; return 301 https://$server_name$request_uri;
} server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name api.example.com; ssl_certificate /etc/letsencrypt/live
upstream api_backend { server localhost:3000; keepalive 32;
} upstream app_backend { server localhost:5000; keepalive 32;
} server { listen 80; listen [::]:80; server_name api.example.com app.example.com; return 301 https://$server_name$request_uri;
} server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name api.example.com; ssl_certificate /etc/letsencrypt/live - n8n Cloud or self-hosted n8n (optional, for API monitoring)
- Hetzner VPS or Contabo VPS for your server
- Namecheap for domain registration
- DigitalOcean as an alternative hosting option
- SSH access to your Linux server (Ubuntu 20.04 or later preferred)
- A domain name pointing to your server's IP address
- Basic command-line knowledge - Understanding Nginx Reverse Proxy Architecture
- Installing Nginx and Certbot
- Configuring Your First Reverse Proxy
- Setting Up SSL with Let's Encrypt
- Securing Your Configuration
- Getting Started - upstream backend_service: Defines where traffic goes. Point this to your actual backend port.
- listen 80: Listen on HTTP (Certbot will -weight: 500;">upgrade this to HTTPS).
- server_name api.example.com: Your domain. Change this to your actual domain.
- proxy_pass: Routes requests to your backend -weight: 500;">service.
- proxy_set_header directives: Preserve client information (IP, protocol, domain) so your backend app sees the real client. - Enter your email address (for renewal reminders).
- Accept the Let's Encrypt terms of -weight: 500;">service.
- Optionally share your email with the EFF (their choice).