nginx listen port 8443, redirect 8080 port to another IP

M
  • 29 Nov '22
I want my NGINX server listen on port 8443 and accept all requests come to
port 8443, if some requests want use port 8080, I want NGINX redirect this
requests to another NGINX on different IP.
for example my first NGINX has 1.2.3.4:8443 and second NGINX has
5.6.7.8:8080
I want first NGINX can send requests on port 8080 send to second NGINX
Can I do this with NGINX?

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,295923,295923#msg-295923
B
  • 29 Nov '22
Yes - with Proxy_pass you can and if not use Iptables to port forward the
traffic.

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,295923,295924#msg-295924
M
  • 29 Nov '22
Thanks
can you give some example config for this problem?

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,295923,295925#msg-295925