Nginx reverse proxy... how?

I’m pretty new to reverse proxy stuff and I thought I’d try setting one up for some of my hosted services such as qbittorrent, dietpi-dashboard, *arr apps etc. There’d be less open ports on my router too.

I first tried following the linode tutorial but that seemed to not work. Then, I saw a mention of adguard home on the forums and adapted it for dietpi-dashboard (port 5252), leaving me with:

location /terminal {
        proxy_pass http://localhost:5252;
}

in a file at /etc/nginx/sites-dietpi/terminal.conf

nginx seemed OK with it, and after reloading I tried [domain]/terminal which appeared to work – The title showed up in the browser so I know nginx properly redirected the request to port 5252, but the page was totally white and the console shows most/all of the requests failed.

Is there any good tutorials on how to set up nginx reverse proxies properly? Obviously could just ask for some config to copy for myself but I thought I’d try learning a bit in the process :smiley: Thanks yall!

The DietPi dashboard don’t support reverse proxy request yet [Request] Adding base URL support for reverse proxy possibility · Issue #113 · ravenclaw900/DietPi-Dashboard · GitHub

1 Like

IMO this is a quite good starting point, showing the aspects of a reverse proxy. Depending on the app you wanna reverse proxy you need to pass other stuff, like request headers etc.

https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/

1 Like

Good to know :slight_smile: I’ve had more success with qbittorrent since they provide an nginx config example but need to set up SSL for it now