zope/plone cache rewrite rules?
Aleksandar Lazic
al-nginx at none.at
Sat Jan 5 20:28:20 MSK 2008
Sorry but I can't read this, due the fact I'am not a html-parser ;-)
Please can you resend it with text only ;-)
Thanks
Aleks
--- full qoute to see how I see it.
On Fre 04.01.2008 14:08, Alexis Torres Garnica wrote:
><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
><html>
><head>
> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
> <title></title>
></head>
><body bgcolor="#ffffff" text="#000000">
>Tnks for your answer Aleksandar Lazic, I was slow to respond because a
>problem in the squid configuration, Im trying this configuration based
>in your:<br>
><br>
> location /ultimas/ {<br>
> #proxy_pass
><a class="moz-txt-link-freetext" href="http://132.247.1.32:8080/http/www.jornada.unam.mx/80/ultimas">http://132.247.1.32:8080/http/www.jornada.unam.mx/80/ultimas</a>;<br>
> #proxy_pass
><a class="moz-txt-link-freetext" href="http://132.247.1.32:8080/http/${http_host">http://132.247.1.32:8080/http/${http_host</a>}/80/ultimas;<br>
> #proxy_pass
><a class="moz-txt-link-freetext" href="http://132.247.1.32:8080/http/132.248.10.56/80/ultimas">http://132.247.1.32:8080/http/132.248.10.56/80/ultimas</a>;<br>
> #proxy_pass
><a class="moz-txt-link-freetext" href="http://132.247.1.32:8080/http/impresa.jornada.com.mx/80/ultimas">http://132.247.1.32:8080/http/impresa.jornada.com.mx/80/ultimas</a>;<br>
> #proxy_pass
><a class="moz-txt-link-freetext" href="http://132.247.1.32:8080/http/www.jornada.unam.mx/ultimas">http://132.247.1.32:8080/http/www.jornada.unam.mx/ultimas</a>;<br>
> #proxy_pass
><a class="moz-txt-link-freetext" href="http://132.247.1.32:8080/http/${http_host">http://132.247.1.32:8080/http/${http_host</a>}/ultimas;<br>
> #proxy_pass
><a class="moz-txt-link-freetext" href="http://132.247.1.32:8080/http/132.248.10.56/ultimas">http://132.247.1.32:8080/http/132.248.10.56/ultimas</a>;<br>
> proxy_pass
><a class="moz-txt-link-freetext" href="http://132.247.1.32:8080/http/impresa.jornada.com.mx/ultimas">http://132.247.1.32:8080/http/impresa.jornada.com.mx/ultimas</a>;<br>
> }<br>
><br>
>in each case I just get this if I do
><a class="moz-txt-link-freetext" href="http://impresa.jornada.com.mx:81/ultimas/">http://impresa.jornada.com.mx:81/ultimas/</a><br>
><br>
><i>The requested URL could not be retrieved<br>
><br>
>While trying to retrieve the URL: <a class="moz-txt-link-freetext" href="http://denypool/denyme">http://denypool/denyme</a><br>
><br>
>The following error was encountered:<br>
><br>
> Unable to determine IP address from host name for denypool <br>
><br>
>The dnsserver returned:<br>
><br>
> Name Error: The domain name does not exist. <br>
><br>
>This means that:<br>
><br>
> The cache was not able to resolve the hostname presented in the URL. <br>
> Check if the address is correct. <br>
><br>
>Your cache administrator is <a class="moz-txt-link-abbreviated" href="mailto:webmaster at jornada.com.mx">webmaster at jornada.com.mx</a>.<br>
>Generated Fri, 04 Jan 2008 20:05:22 GMT by squidtest.jornada.unam.mx
>(squid/2.5.STABLE14) <br>
></i><br>
>last question Aleksandar, why do you removed the /80/ in the rule?<br>
><br>
>tnks for your help :D and nice week end for all guys =).<br>
><br>
><br>
>Aleksandar Lazic escribió:
><blockquote cite="mid20080101121440.GA9700 at none.at" type="cite">Hi,
> <br>
> <br>
>On Mon 31.12.2008 15:45, Alexis Torres Garnica wrote:
> <br>
> <blockquote type="cite">Hi guys, I have problems porting this apache
>mod_rewrite rules to
> <br>
>nginx rewrite rules, I have a zope server who talk with squid
> <br>
>(configured like a reverse proxy), infront the squi we have apache2,
> <br>
>the arch is this:
> <br>
> <br>
>people -> request -> apache -> squid -> zope
> <br>
> <br>
>we wanna replace apache with nginx, the actual apache rewrite rules
> <br>
>are this for <a class="moz-txt-link-freetext" href="http://domain/ultimas:">http://domain/ultimas:</a>
> <br>
> <br>
>RewriteRule ^/ultimas(.*)/$
> <br>
> <a class="moz-txt-link-freetext" href="http://127.0.0.1:8080/http/%{SERVER_NAME">http://127.0.0.1:8080/http/%{SERVER_NAME</a>}/80/ultimas$1 [L,P]
> <br>
>RewriteRule ^/ultimas(.*)
><a class="moz-txt-link-freetext" href="http://127.0.0.1:8080/http/%{SERVER_NAME">http://127.0.0.1:8080/http/%{SERVER_NAME</a>}/80/ultimas$1 [L,P]
> <br>
> </blockquote>
> <br>
>You need at least 0.6.18 so that you can use variales in proxy_pass.
> <br>
>You should take a look into <br>
><a class="moz-txt-link-freetext" href="http://wiki.codemongers.com/NginxHttpCoreModule#location">http://wiki.codemongers.com/NginxHttpCoreModule#location</a>
> <br>
><a class="moz-txt-link-freetext" href="http://wiki.codemongers.com/NginxHttpProxyModule#proxy_pass">http://wiki.codemongers.com/NginxHttpProxyModule#proxy_pass</a>
> <br>
> <br>
>I would try this:
> <br>
> <br>
>location ^/ultimas(.*) {
> <br>
> <br>
> proxy_pass <a class="moz-txt-link-freetext" href="http://127.0.0.1:8080/http/${http_host">http://127.0.0.1:8080/http/${http_host</a>}/ultimas$1;
> <br>
> <br>
>}
> <br>
> <br>
> <blockquote type="cite">This is for the virtual host called migarcion
> <br>
> <br>
>RewriteCond %{REQUEST_FILENAME} .*jpg$|.*gif$|.*png$ [NC]
> <br>
>RewriteCond %{HTTP_REFERER} !^$
> <br>
>RewriteCond %{HTTP_REFERER} !migracion\.jornada\.unam\.mx [NC]
> <br>
>RewriteRule ([0-9]{4})/([0-9]{2})/([0-9]{2})/?(.*)
><a class="moz-txt-link-freetext" href="http://%{SERVER_NAME">http://%{SERVER_NAME</a>}/showpic.php?pic=$1/$2/$3/$4 [L]
> <br>
> </blockquote>
> <br>
><a class="moz-txt-link-freetext" href="http://wiki.codemongers.com/NginxHttpRefererModule">http://wiki.codemongers.com/NginxHttpRefererModule</a>
> <br>
> <br>
>location ~* \.(gif|jpg|png)$ {
> <br>
> <br>
> valid_referers migracion.jornada.unam.mx;
> <br>
> if ($invalid_referer){
> <br>
> return 403;
> <br>
> }
> <br>
> <br>
> if($request_uri ~ "([0-9]{4})/([0-9]{2})/([0-9]{2})/?(.*)" ){
> <br>
> # for this I'am not sure
> <br>
> proxy_pass <a class="moz-txt-link-freetext" href="http://${http_host">http://${http_host</a>}/showpic.php?pic=$1/$2/$3/$4;
> <br>
> }
> <br>
>}
> <br>
> <br>
> <blockquote type="cite">This is for one virtual host called ciencias
> <br>
> <br>
>RewriteCond %{REQUEST_FILENAME} .*jpg$|.*gif$|.*png$ [NC]
> <br>
>RewriteCond %{HTTP_REFERER} !^$
> <br>
>RewriteCond %{HTTP_REFERER} !ciencia\.jornada\.unam\.mx [NC]
> <br>
>RewriteRule ([0-9]{4})/([0-9]{2})/([0-9]{2})/?(.*)
><a class="moz-txt-link-freetext" href="http://%{SERVER_NAME">http://%{SERVER_NAME</a>}/showpic.php?pic=$1/$2/$3/$4 [L]
> <br>
> </blockquote>
> <br>
>Similar the the up one, only with diff referer host ;-).
> <br>
> <br>
>Hth
> <br>
> <br>
>Aleks
> <br>
> <br>
> <br>
></blockquote>
><br>
></body>
></html>
>
----
More information about the nginx
mailing list