Zach Taiji's Wiki

Home

❯

pages

❯

Nginx Reverse Proxy Configuration Guide

Nginx Reverse Proxy Configuration Guide

Oct 04, 20251 min read

  • guide

banner

  1. Create a subdomain.domain.tld file under /etc/nginx/sites-available using the following:
server {
	server_name  subdomain.domain.tld;
 
	location / {
		proxy_pass            http://127.0.0.1:DOCKERPORT;
		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      Upgrade $http_upgrade;
		proxy_set_header      Connection "Upgrade";
	}
 
	access_log /var/log/nginx/subdomain.domain.tld-access.log;
	error_log  /var/log/nginx/subdomain.domain.tld-error.log;
 
}
 
  1. Symlink to /etc/nginx/sites-enabled with the following command:
cd ../sites-enabled/
sudo ln -s ../sites-available/subdomain.domain.tld subdomain.domain.tld
  1. Test nginx config:
sudo nginx -t
  1. If that passes, reload nginx:
sudo systemctl reload nginx
  1. Generate certs:
sudo certbot --nginx -d subdomain.domain.tld

Graph View

Backlinks

  • Resources & Wiki & Bookmarks

Created with Quartz v4.5.2 © 2025

  • Blog