Ngnix as Proxy with Multiple Directories Issue

ckozler nginx-forum at nginx.us
Fri Aug 19 14:24:48 UTC 2011


Hi Everyone,

I am having an odd issue here with Ngnix as a my proxy for my pages
served up by Apache.  This is a pretty vanilla proxy setup - the issues
I am facing (and my respective config) are as follows:

I have my DNS and everything setup properly so I know that is not an
issue.  All requests to licensing.fixflyer.com and licensing are sent to
the Ngnix web proxy and I can confirm that it is not in fact any DNS
issue.  With that - 




The issue:

Whenever I type licensing/downloads or licensing.fixflyer.com/downloads
it redirects me to http://licensing/licensing.fixflyer.com/downloads and
http://licensing.fixflyer.com/licensing.fixflyer.com/downloads
(respectively depending on which request was made) - the same goes for
the downloads domain as well.

I am thinking I need to add a location block for every directory that I
want to proxy for but that seems a little wrong - shouldnt any request
to licensing.fixflyer.com regardless of the directory path be
automatically resolved and not auto-appended as such?



My configuration


worker_processes  50;

events {
    worker_connections  1024;
}

http {
	# Debugging M2 error
	error_log	/var/log/nginx/debug.err.log debug;
	proxy_buffer_size 64k;
	proxy_buffers 4 64k;
	proxy_busy_buffers_size 128k;
	proxy_temp_file_write_size 128k;
	client_body_buffer_size 1024m;
	keepalive_timeout 500;
	#
	include       mime.types;
    	default_type  application/octet-stream;
    	sendfile        on;

	client_max_body_size 500m;


	server {
		listen		80;	
		server_name	licensing.fixflyer.com licensing;

		location / {
			proxy_pass http://web.ny1.prod.fixflyer.com/licensing.fixflyer.com/;
                        proxy_set_header Host $host;
                        proxy_set_header        X-Real-IP      
$remote_addr;
                        proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for;
		}
	
	}

	#
	# Download portal
	#	
	server {
		listen		80;
		server_name	downloads downloads.fixflyer.com;
		location / {
			proxy_pass http://web.ny1.prod.fixflyer.com/downloads.fixflyer.com/;
			#proxy_set_header Host $http_host;
			proxy_set_header Host $Host;
			proxy_set_header        X-Real-IP       $remote_addr;
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		}
		#location uploads {
		#	proxy_pass http://$http_host/uploads;
		#	proxy_set_header Host $http_host;
		#	proxy_set_header	X-Real-IP	$remote_addr;
		#}
	}

}

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214049,214049#msg-214049



More information about the nginx mailing list