guys help im frozen in time

i post more on my FediPub Activityverse: @mothcompute@vixen.zone it is where i talk about all my fun projects


atomicthumbs
@atomicthumbs

does anyone know a good way I can host Nginx serving something on port 80 on a specific subdomain, and another web server on port 80 on another subdomain, on the same IP address. i may have computered myself into a corner


atomicthumbs
@atomicthumbs

flipping a large and obnoxious coin to figure out whether I'm using caddy or Nginx as the reverse proxy


You must log in to comment.

in reply to @atomicthumbs's post:

definitely a virtual hosts situation. probably the easiest way is to set up one vhost for the subdomain you want to host on nginx itself and then another that reverse-proxies to the other webserver (which you'll have to bump over to a different port — if that can't be configured you may need to containerize it). nginx is pretty much the HTTP swiss army knife and this is easily within its capacity

of course

you just need to configure something as a reverse proxy that looks at the Host: header and locally proxies the request to a web server running on a non-public port as needed

most web servers can be configured to do that, so you can have nginx do it, or have the other server do it, or even put a dedicated reverse proxy such as HAProxy in front of both of them

yeah you can even serve static content since each of those server blocks is chosen based on the Host header, which is mandatory in http/1.1 onwards (basically forever now)

i just set this up myself the other weekend.

theoretically you use virtual hosts, and configure one of the subdomains to use Nginx as a proxy server that talks to your other web server, which is actually running on port 8080 or something. this is what a lot of Nginx installs are used for, a proxy front-end for some web app that's running on an entirely different port

I would link to docco about all this but it's all terrible, of course

[edit] wow, seriously beaten to the punch here

in reply to @atomicthumbs's post: