Welcome! Log In Create A New Profile

Advanced

Apache Proxy Pass to Nginx Configuration

Posted by tchong 
Apache Proxy Pass to Nginx Configuration
November 04, 2011 04:48PM
Hello,

I am new to Nginx, and have be struggling with a proxy pass configuration from Apache.

Currently, my apache config is setup as a reverse proxy. Basically, it takes this url http://main/services/env/service_name/version/status and proxies the request to a new URL http://VIP/service_name/version/status, which is all seemless to the user.

From my apache config:

<LocationMatch /services/env$>
Redirect /services/env http://main/services/env/
</LocationMatch>
<Location /services/devnre/>
ProxyPass http://VIP:8011/
RequestHeader set X-Url-Prefix "http://main/services/devnre"
</Location>

Thanks a lot.
Re: Apache Proxy Pass to Nginx Configuration
November 04, 2011 05:26PM
After 2 days of scratching my head, it just hit me what was wrong.

location /services/env/ {
proxy_pass http://vip:8011;
proxy_set_header X-Url-Prefix http://main/services/env;


I forgot the trailing slash here:


proxy_pass http://vip:8011/;

All is working now. Whew. Now time for some load testing.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 301
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready