Monday, April 26, 2021

Nginx Reverse Proxy

Today we'll learn how to configure Nginx as a reverse proxy. First we need to download Nginx from its website. At the moment of this writing we use nginx version 1.19.10. After downloading and extracting it to a folder, we can click nginx.exe. Then verify that it is running by opening browser and type http://localhost/




This page contains commands to start, stop nginx.


Next we need to configure reserve proxy. Open nginx.conf in C:\nginx-1.19.10\conf folder.


In the http->server->location add proxy_pass. Here we add proxy_pass http://localhost:9899/; as we want to hide our gateway-server app behind reverse proxy.


Now in the browser we can use http://localhost/greeting/morning instead of our gateway-server app http://localhost:9899/greeting/morning.



0 comments:

 

©2009 Stay the Same | by TNB