Skip to content

Tag: reverse proxy

Cleaner nginx proxy configs

I’ve been slowly teaching myself self-hosting things over the past few years. I’ve got a decent variety of things running at home. But I find it frustrating to keep track of their IPs and ports so I setup a reverve proxy which is a fancy term for one little linux container on my network directs you to everything else. Now I can hit plex.domain.tld, or wiki.domain.tld and get to where I want to go.

I had all of these setup with their own individual config files were very short. Most of them were little more than:

# A small thing running on a raspberry pi

server {
listen 80;
server_name pi.domain.tld

location / {
proxy_pass http://192.168.0.99:80;
}
}

I know there’s an easier way. And tonight I found a post that laid it all out and it clicked for me.

Timothy Quinn’s Using Nginx as a Reverse Proxy for Multiple Sites laid it all out and I realized all I needed to do was add all of my little config files to one big file. And I add a comment to the front of  each config to remind myself what it was and anything important to remember. This worked great for my Tiddlywiki, RSS reader, Calibre-web and Bookstack instance I have running.

His example is for sites with SSL enabled which I’m not going to move tonight. But I replicated this for all of my sites not running SSL. My next task is to move the SSL-enabled ones. But I run Nextcloud for myself and my wife so I need to take more time and make sure I do that right since it’s as close to a “production” thing that I self-host. So if it’s down, it affects more than just me.