homepage Welcome to WebmasterWorld Guest from 54.211.95.201
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
ReverseProxy help.
How to pass static content requests to another server
Cyberpundit




msg:4318257
 9:37 pm on May 26, 2011 (gmt 0)

Hi. I have set up Nginx to handle static content so that Apache's "prefork" processes are focused on doing the heavylifting related to PHP.

Nginx is working. I set it up on the same server, but a different port. Confirmed working at [EXAMPLEDOMAIN.com:81....]

Inside Apache I now want to internally redirect all my access to images to NGINX:

ProxyRequests Off
ProxyPreserveHost On
ProxyPass /main/images http://0.0.0.0:81/
ProxyPassReverse / http://0.0.0.0:81/


But this is not working as I think it would.

The following URL is live and works:
EXAMPLEDOMAIN.COM:81/test.gif (nginx)

This gives a 404:
EXAMPLEDOMAIN.COM/main/images/test.gif (apache)


Any ideas what I can change to make this work? aren't the Apache setting correct?

Thanks!

Thanks!

 

jdMorgan




msg:4318873
 1:08 am on May 28, 2011 (gmt 0)

In most cases like this, the paths specified for ProxyPass and ProxyPassReverse should be the same.

Make sure this config block isn't located inside a <Location> container that would further (and undesirably) qualify it. Also, ProxyPass and ProxyPassReverse cannot be used inside <Directory> or <Files> containers.

Jim

Cyberpundit




msg:4318887
 2:23 am on May 28, 2011 (gmt 0)

Thanks Jim. Can this be inside a VirtualHost container? Right now it is outside, just at the end of httpd.conf, and still NOT working.

I even changed the 0.0.0.1 to 127.0.0.1:


ProxyRequests Off
ProxyPreserveHost On
ProxyPass /site/images http://127.0.0.1:81/
ProxyPassReverse /site/images http://127.0.0.1:81/



This is still giving 404. In error_log, apache just says file not found or unable to stat.

I have checked through "httpd -M" and all the proxy modules are in fact enabled!

What am I missing? Thanks.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved