Nginx help

barrydocks

Member
May 3, 2023
33
1
13
Not really a PVE problem I know. So I have a few internet facing VMs running mail, Immich, Nextcloud, etc. I need to mange DNS for incoming connections so I have set up a Nginx server with proxy manager GUI and a LXC using those very helpful Proxmox helper scripts .
For example I have:
nextcloud.example.com on port 443 at 192,168.1.2
webmail.example.com on port 443 and 80 at 192.168.1.3

I can set up the forwarding for a single port but how do I set up all multiple ports?
 
Do you really want to forward ALL ports? that seems risky. You might want to forward ports 25, 587 and maybe 465 for mail, then forward those to the mail server (bypassing nginx). All of your 443/80 traffic can be forwarded to the nginx instance and let it handle proxy duties. If you are doing IMAP and POP 993, 110, 143, etc. forward those as well to your mail server. Nginx is really only for proxying HTTP/S traffic ingress, then you would send the email traffic direct to your firewall/load balancer or MTA server depending on how you have your stack setup.

If you are trying to have nginx proxy all email traffic as well, you will want to follow the process here: https://docs.nginx.com/nginx/admin-guide/mail-proxy/mail-proxy/

HTH