Welcome! Log In Create A New Profile

Advanced

Need NGINX Configuration Rule

Posted by DeepakIngwale 
Need NGINX Configuration Rule
January 10, 2019 10:20PM
Hello Friends,

I am very new to the NGINX so , some of you may find my query very basic, but please do help me .

We have 2 boxes

1. Gateway - where NGINX is running and which is exposed to public INTERNET and where we want to setup reverse proxy.

2. Application Server where my web server is running and its with PrivateIP only exposed to NGINX

So any request, which comes to NGINX should be routed to my Web Application. So I wanted to setup reverse proxy
in such a way that if someone hits

<Gateway_URL>/proxypath/xxxx/yyyy

it should get translated to <private_web_server_URL>/xxxx/yyyy

So please help me to find the reverse proxy configuration rule in NGINX, which should be dynamic for any request which come with <Gateway_URL>/proxypath/anypattern get translated to <private_web_server_URL>/anypattern,
In short part '<Gateway_URL>/proxypath/' in the URL should replace with '<private_web_server_URL>/' by keeping other part same.



Edited 1 time(s). Last edit at 01/10/2019 10:22PM by DeepakIngwale.
Re: Need NGINX Configuration Rule
March 19, 2019 10:51PM
1. Wrong forum. You should post it to “How to…”: https://forum.nginx.org/list.php?11

2. For this question, what you need is `proxy_pass` directive. See https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 82
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready