Conversation

hmm i wonder if there's a way to set up nginx that way i can get domain x listening on :80 but not :443, while i have domain y listening on :443 but not :80 and both domains have the exact same config otherwise

2
1
0

@niko i tried doing that a while back (one over an ip address and the other over a domain name and with ssl), i think i ended up needing to have 2 config entries anyway, either that or i gave up
ik you can specify the “listen” thing multiple times but afaik the domain stays the same

0
0
0

for context i'm trying to set up a tor hidden service that uses the exact same nginx config save for the listeners for my libreddit instance

1
0
1

@niko if the tor onionsite is the only service running on port 80, i dont think nginx cares about the domain name for requests on that port, since it just selects the first service and uses that as the fallback for everything (i think)
and since its the only service all requests should be sent there

1
0
0

@niko hmm
the only other solution i can think of is to have a server running on port 80 delivering everything, and then on port 443 a proxy which runs through the port 80 one, but that would probably introduce some issues

0
0
0

@niko @kemona_halftau you can redirect based on hostname, if ($host == ...) I think but I can’t check now

1
0
1

@noisytoot @kemona_halftau i can set up other listeners for :80 in another server block still just fine and i have it working right now, the issue is just  deduplicating my config mostly

0
0
1