You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by li...@gmail.com on 2008/04/06 02:54:26 UTC

[users@httpd] Question: ProxyPass not working??

Hi, folks:

On my websites, I want links like the following:

http://example.com/images/pic.jpg

silently grab the image from

   http://192.168.53.93/images/pic.jpg     [internal IP]
     or
   http://imgserver.com/images/pic.jpg     [external IP]

example2.com(192.168.53.93) is a separate(physically) server where we
host all images on our website.  in my httpd.conf, I've added.

    ProxyRequests Off
    ProxyErrorOverride On
    <Location /images>
        ProxyPass http://imgserver.com/images/
               [I also tried the interal IP]
        ProxyPassReverse http://imgserver.com/images/
    </Location>

The above configuration did not work, I get 403 error by visiting
"http://example.com/images/pic.jpg", but I can access
http://imgserver.com/images/pic.jpg from web browser without problem.
[firewall enabled around our Internal NAT]

Really new to configuring ProxyServer, Can anyone tell me what I did
wrong or did I miss out some configuration that is necessary to make
the proxypass working..

Many thanks..

lihao

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Question: ProxyPass not working??

Posted by Paul Heath <ph...@googlemail.com>.
discovered it was that i should have been running php5apache2_2.dll not
php5apache2.dll.....many thanks



On 4/6/08, Eric Covener <co...@gmail.com> wrote:
>
> On Sat, Apr 5, 2008 at 8:54 PM,  <li...@gmail.com> wrote:
> > Hi, folks:
> >  The above configuration did not work, I get 403 error by visiting
> >  "http://example.com/images/pic.jpg", but I can access
> >  http://imgserver.com/images/pic.jpg from web browser without problem.
> >  [firewall enabled around our Internal NAT]
>
> error log with LogLevel debug?
>
> --
> Eric Covener
> covener@gmail.com
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


-- 
Rgds
Paul Heath
Mobile: +44(0)7960 016965

Re: [users@httpd] Question: ProxyPass not working??

Posted by li...@gmail.com.
On Mon, Apr 7, 2008 at 10:47 AM, Eric Covener <co...@gmail.com> wrote:
> On Mon, Apr 7, 2008 at 10:36 AM,  <li...@gmail.com> wrote:
> > Hi, Eric:
> >
> >  Thank you very much for your response. I've set
> >
> >     RewriteLogLevel 4
> >     RewriteLog "/var/log/www/rewrite.log"
> >
> >  and found that Apache did not check ProxyPass rules at all. If I added:
> >
> >     RewriteRule ^/pics/(.*\.jpg)$    http://192.168.53.93/pics/$1   [P,L]
> >
> >  This worked as expected, but my questions are:
> >  (1) can this hide the backend image server from outside? how can I check this??
> >  (2) How can I make the ProxyPass work if I want to make some
> >  fine-controls over the proxy..
>
> In 2.0 you can't count on when proxypass and rewrite run relative to
> eachother from system to system. In 2.2. and higher it's at least
> explicitly coded (although I don't recall which comes first)
>
> Don't mix proxypass and Rewrite-with-proxy for the same URL-space.
>
> On systmes where by luck of the draw ProxyPass runs first, you might
> see your rewriterules skipped.

Hi, Eric:

Thank you for your input. I actually tested ProxyPass method and
Rewrite-with-proxy method separately. Probably I need to check why the
ProxyPass did not invoked? this infomation should be recorded in
RewriteLog file, right?  )  really appreciate your time.. :-)

BTW. I am using Apache 2.2.3

Best regards,
lihao

> --
>
> Eric Covener
> covener@gmail.com
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Question: ProxyPass not working??

Posted by Eric Covener <co...@gmail.com>.
On Mon, Apr 7, 2008 at 10:36 AM,  <li...@gmail.com> wrote:
> Hi, Eric:
>
>  Thank you very much for your response. I've set
>
>     RewriteLogLevel 4
>     RewriteLog "/var/log/www/rewrite.log"
>
>  and found that Apache did not check ProxyPass rules at all. If I added:
>
>     RewriteRule ^/pics/(.*\.jpg)$    http://192.168.53.93/pics/$1   [P,L]
>
>  This worked as expected, but my questions are:
>  (1) can this hide the backend image server from outside? how can I check this??
>  (2) How can I make the ProxyPass work if I want to make some
>  fine-controls over the proxy..

In 2.0 you can't count on when proxypass and rewrite run relative to
eachother from system to system. In 2.2. and higher it's at least
explicitly coded (although I don't recall which comes first)

Don't mix proxypass and Rewrite-with-proxy for the same URL-space.

On systmes where by luck of the draw ProxyPass runs first, you might
see your rewriterules skipped.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Question: ProxyPass not working??

Posted by li...@gmail.com.
Hi, Eric:

Thank you very much for your response. I've set

    RewriteLogLevel 4
    RewriteLog "/var/log/www/rewrite.log"

and found that Apache did not check ProxyPass rules at all. If I added:

    RewriteRule ^/pics/(.*\.jpg)$    http://192.168.53.93/pics/$1   [P,L]

This worked as expected, but my questions are:
(1) can this hide the backend image server from outside? how can I check this??
(2) How can I make the ProxyPass work if I want to make some
fine-controls over the proxy..

Thanks again,
lihao

On Sun, Apr 6, 2008 at 12:18 PM, Eric Covener <co...@gmail.com> wrote:
> On Sat, Apr 5, 2008 at 8:54 PM,  <li...@gmail.com> wrote:
> > Hi, folks:
> >  The above configuration did not work, I get 403 error by visiting
> >  "http://example.com/images/pic.jpg", but I can access
> >  http://imgserver.com/images/pic.jpg from web browser without problem.
> >  [firewall enabled around our Internal NAT]
>
> error log with LogLevel debug?
>
> --
> Eric Covener
> covener@gmail.com
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Question: ProxyPass not working??

Posted by Eric Covener <co...@gmail.com>.
On Sat, Apr 5, 2008 at 8:54 PM,  <li...@gmail.com> wrote:
> Hi, folks:
>  The above configuration did not work, I get 403 error by visiting
>  "http://example.com/images/pic.jpg", but I can access
>  http://imgserver.com/images/pic.jpg from web browser without problem.
>  [firewall enabled around our Internal NAT]

error log with LogLevel debug?

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Question: Which Directives responsible for 'Cach-Control' header?

Posted by Neil Simons <ne...@hotmail.com>.
Hi all,

I have a Fedora Core5 linux box running apache 2.2.2

When serving static files of certain extentions including .mp3, 
'Cache-Control' headers are included in the response, as well as 'ETag' 
headers etc.

My question is simply this: How can I stop the 'Cache-Control' headers being 
generated?

I can successfully stop the generation of ETag headers using 'FileETag 
None', but cannot find any documentaion on the control of the 
'Cache-Control' header.

At this point, the following modules are disabled;
mod_proxy_
mod_cache
mod_expires

mod_mime_magic
mod_expires
mod_proxy_*


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Question: ProxyPass not working??

Posted by Eric Covener <co...@gmail.com>.
On Mon, Apr 7, 2008 at 11:43 AM, hugh williams <hu...@soco.agilent.com> wrote:

>  At least one reason you are having problems is that the ProxyPass and
> ProxyPassReverse directives are incorrect. these statements require two
> arguments, not one.  So try changing the lines to
>

The one-argument form is used when you put the ProxyPass directives in
a <Location> block (because the other argument is divined from the
Location)

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: Question: ProxyPass not working??

Posted by hugh williams <hu...@soco.agilent.com>.

lihao0129@gmail.com wrote:
> Hi, folks:
>
> On my websites, I want links like the following:
>
> http://example.com/images/pic.jpg
>
> silently grab the image from
>
>    http://192.168.53.93/images/pic.jpg     [internal IP]
>      or
>    http://imgserver.com/images/pic.jpg     [external IP]
>
> example2.com(192.168.53.93) is a separate(physically) server where we
> host all images on our website.  in my httpd.conf, I've added.
>
>     ProxyRequests Off
>     ProxyErrorOverride On
>     <Location /images>
>         ProxyPass http://imgserver.com/images/
>                [I also tried the interal IP]
>         ProxyPassReverse http://imgserver.com/images/
>     </Location>
>
> The above configuration did not work, I get 403 error by visiting
> "http://example.com/images/pic.jpg", but I can access
> http://imgserver.com/images/pic.jpg from web browser without problem.
> [firewall enabled around our Internal NAT]
>
> Really new to configuring ProxyServer, Can anyone tell me what I did
> wrong or did I miss out some configuration that is necessary to make
> the proxypass working..
>
> Many thanks..
>
> lihao
>   

Hello;

At least one reason you are having problems is that the ProxyPass and 
ProxyPassReverse directives are incorrect. these statements require two 
arguments, not one.  So try changing the lines to

ProxyPass /images/ http://imgserver.com/images/

ProxyPassReverse  /images/  http://imgserver.com/images/

and see what happens.

hugh

-- 
 Hugh Williams                  "More men are killed by overwork than the
 hugh_williams@agilent.com       importance of the world justifies."
 Agilent Technologies                           - Rudyard Kipling
 Santa Rosa 4US-R                             "The Phantom Rickshaw", 1888
 (707)-577-4941



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org