1

I want to ask you if there is a possibility to configure NginX as http proxy and stream proxy on the same NginX server? Or should it be splited on two machines, one as http proxy, another as stream proxy?

Do you have experience with that kind configuration?

Thanks in advance for any suggestions.

0

1 Answer 1

2

Yes, you can have stream and http reverse proxy on same instance. BUT you will have to configure two listening ports, to be more specific two different IP-port pairs. As instance: HTTP to *:80 and stream to *:8080. It is not possible to set up http and stream mode on same ip and port. Still, you have another option, IP aliasing. Your NIC can hold 2 IPs (IP1 and IP2), then set up HTTP proxy for IP1 (i.e. IP1:80) and stream for second, IP2 (i.e. IP2:80).

I usually use the second option, so I can point several domains to a single proxy server (still I encourage you to explore keepalived HA)

1
  • Many thanks for advice. I just wonder how to configure it properly. I have such a case: HTTP proxy for domain.com -> IP:portX It's current, working configuration. What I neeed to do is to add stream proxy for the same doamain: STREAM proxy for domain.com:portY -> THE_SAME_IP:portY
    – gaspar
    Commented Sep 7, 2022 at 11:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .