It's the first time I really work with nginx so please forgive me if I misuse terminology here.
So our companies network has a static IP to which I send requests from multiple sub-domains:
jitsi.domain.ext -> public IP
sub2.domain.ext -> public IP
...
Those requests pass through the firewall and port forwarding to my dedicated nginx server and shall be routed from there to other local servers like so:
jitsi.domain.ext -> local server (jitsi server)
sub2.domain.ext -> local server (website)
...
For this I created besides the untouched global config a separate config for each subdomain and put it in
/etc/nginx/sites-available
and via ln -s
linked to /etc/nginx/sites-enabled
like so:
# jitsi.domain.ext
server {
listen 80;
listen 443 ssl;
ssl_certificate /etc/nginx/cert/jitsiCert.pem;
ssl_certificate_key /etc/nginx/cert/jitsiKey.pem;
server_name jitsi.domain.ext;
location / {
proxy_read_timeout 300s;
proxy_connect_timeout 75s;
proxy_pass http://192.168.0.139;
proxy_redirect off;
}
}
The config is called just fine but it literally redirects me to the URL "192.168.0.139" in the browser. Which of course doesn't work when I am outside of the network and want to access it.
The .pem I use is the one I created for the Jitsi server. I figured that's the easiest way to do it since the dedicated Jitsi server uses nginx as well and I don't want to tamper with it to not break any future updates it gets.
If anyone has a clue for me, I'd be grateful. I tried to get something out of the docs and countless other similar issues discussed on the internet, but nothing seemed to do the trick for me. Thanks in advance!
With the help of Ivan Shatsky I came to realise that the "problem" indeed is the redirection of jitsi's nginx and not the configuration of my "gateway" nginx.
Russel August helped me solve that problem here and here.