How to use NGINX with private and internal IPs


If you are behind NAT, you can’t. The Public IP listen match syntax can only work if your system also has the Public IP specifically assigned to the machine, and not behind NAT or port forwarding.

If the public IP address is, however, bound to the machine, and not behind some router that you’re doing port-forwarding with, then listen public.ip.add.ress would do what you’re looking for, with its own config block and settings for the site.