António P. P. Almeida Wrote: ------------------------------------------------------- > So there's no concept of scope in the usual > programming language > sense. It just depends on the request. If the > request visits all > locations where variables are set, then the values > are set > independently of the context level at which the > assignment > instructionby Dayo - Nginx Mailing List - English
Hi Maxim! Hi Igor! Maxim Dounin Wrote: ------------------------------------------------------- > > The error log file does log other errors. > > This is fine, but doesn't explain why don't see > the one in > question. It's hard to say anything without > seeing the full > config. I went back to look over my config in detail and noticed I was generating twoby Dayo - Nginx Mailing List - English
kaspars Wrote: ------------------------------------------------------- > My understanding is that > if "fastcgi_cache_bypass 1", then Nginx will > request a fresh response from the backend and > cache that response for further use where > "fastcgi_cache_bypass 0". > > Is that how fastcgi_cache_bypass should work? No idea as it is not documentedby Dayo - Nginx Mailing List - English
The point I was trying to make is that in this case for instance, ... set $donot_cache 0; if ($http_cookie ~* "comment_author_|wordpress_(?!test_cookie)|wp-postpass_" ) { set $donot_cache 1; } set $test $donot_cache; ... $test will always be equal to 0 as any variable set within the 'if' block is not exposed outside the block AFAIK. So when you run ... set $donot_by Dayo - Nginx Mailing List - English
Hi Maxim! Maxim Dounin Wrote: ------------------------------------------------------- > > Did you see my previous post? > > When I comment out the try files directive, the > index works. > > Again: > > location / { > try_files $uri $uri/; > } > > is an infinite loop. It is expected to generate > 500 for > directorieby Dayo - Nginx Mailing List - English
Hi Maxim! Maxim Dounin Wrote: ------------------------------------------------------- > Hello! > It should log something like "rewrite or internal > redirection > cycle" at "error" level. Obviously enough your > config creates an > infinite loop on processing "/" as you set > try_files's fallback to > effectively the same uri, jby Dayo - Nginx Mailing List - English
Narrowed the issue down to the try_files directive. These configurations work: 1. URL = www.site.com, Result = 200 OK server { ... index index.html; location / { #try_files $uri $uri/; } } 2. URL = www.site.com, Result = 200 OK server { ... location / { index index.html; #try_files $uri $uri/; } }by Dayo - Nginx Mailing List - English
kaspars Wrote: ------------------------------------------------------- > if ($http_cookie ~* > "comment_author_|wordpress_(?!test_cookie)|wp-post > pass_" ) { > set $donot_cache 1; > } AFAIK, the '$donot_cache ' you set here will not contain anything outside the if block. and therefore your no_cache test will always be done on an empty variable. Variable scopby Dayo - Nginx Mailing List - English
server { ... index index.html; location / { error_log /path/to/log debug; try_files $uri $uri/; } } ...gives me an empty error log file. I don't think my isp has cached the response because as soon as I change to ... server { ... index index.html; location / { try_files $uri $uri/ @proxy; } } It starts working ... using the apache indexby Dayo - Nginx Mailing List - English
Igor Sysoev Wrote: ------------------------------------------------------- > Standard nginx modules logs a reason of 500 error. I have done a plain vanilla build of v0.8.54 without any third party modules and I both still get the same results and do not have anything in the error log. Not sure why nothing is getting logged but at least I know this is not down to the third party modules.by Dayo - Nginx Mailing List - English
Please, Please, Please give us an option to switch this preview thing off. As suggested, consider the this: http://www.phorum.org/phorum5/read.php?62,133957,141120#msg-141120 and let those that want it switch it on. It makes navigating this site a mini hell.by Dayo - Site Suggestions
Igor Sysoev Wrote: ------------------------------------------------------- > > It seems that the index module does not work > with the try_files > > directive. Would have expected the trying of > '$uri/' to include the > > defined index but it doesn't do so. > > > > Anyone else notice this? > > What is in error_log ? Nothing. Here is my Nby Dayo - Nginx Mailing List - English
Igor Sysoev Wrote: ------------------------------------------------------- > I heard this "centralise" mantra many times. > Believe me, it works until > your configuration fits on screen or two. When it > grows, every, note, > EVERY configuration modification becames > investigation of > configuration dependences. I have an configuraiton > with 180 locaitby Dayo - Nginx Mailing List - English
Just noticed an issue with my 0.8.54 installation. 1. URL = www.site.com, Result = 500 error server { ... index index.html; location / { try_files $uri $uri/; } } 2. URL = www.site.com, Result = 500 error server { ... location / { index index.html; try_files $uri $uri/; } } 3. URL = www.site.com, Result = 200 OK server { ... location / { try_filesby Dayo - Nginx Mailing List - English
Igor Sysoev Wrote: ------------------------------------------------------- > On Fri, Feb 11, 2011 at 05:08:40AM -0500, Dayo > wrote: > > Hello all. > > > > I currently have my php set up as so > > > > > > ... > > location ~ \..*/.*\.php$ { > > return 403; > > } > > location ~* ^.+\.php$ { > > try_filesby Dayo - Nginx Mailing List - English
Hello all. I currently have my php set up as so ... location ~ \..*/.*\.php$ { return 403; } location ~* ^.+\.php$ { try_files $uri/fail @proxy; } location @proxy { proxy pass etc } location some-location-that-sometimes-needs-rewriting-in-apache-htaccess { try_files $uri $uri/ @proxy; } ... Is there a way where when a '.php' file is equested, I just pass tby Dayo - Nginx Mailing List - English
OK finally figured it out I think. Seems it may be to do with the scope of the user set variables (not sure) but after moving adding proxy_no_cache and proxy_cache_bypass to the same location instead of the centrally called ones, It seems to be working as expected. The hint was in agentzh's original post location / { set_by_lua $no_cache ' if ngx.var.cookie_COOKIE == "" or ngxby Dayo - Nginx Mailing List - English
PS. Makes a "proxy_cache_bypass_empty" option more and more appealingby Dayo - Nginx Mailing List - English
Seems as if I may have spoken too soon on the Lua option. Now, it does check for the existence of the cookie and set the variable accordingly, but I am almost drawing the conclusion that proxy_no_cache and proxy_cache_bypass do not accept user defined variables as input as whether the extra content from the backend in my case seems to be a hit or miss affair and it seems the only time I can guaby Dayo - Nginx Mailing List - English
Thanks agentzh. The Lua code you gave works and does what I need here. Still would be great to have an option like ... proxy_cache_bypass_empty $var; proxy_no_cache_empty $var; ... in the main proxy module though. Anyway, solved at least. Thanks again.by Dayo - Nginx Mailing List - English
I throw my hands up in surrender as I just can't get it to return the cookie. I have tried a plain vanilla build with no joy. v0.8.54 The relevant location code is ... location /folder/ { if ($http_cookie !~* "COOKIEX=0") { add_header Cookie "COOKIEX=1; domain=domain.com; path=/folder/"; } # BEGIN Url Rewrites ... # END Uby Dayo - Nginx Mailing List - English
Probably ... headers more isn't working as well. Maybe a third party module is breaking it..by Dayo - Nginx Mailing List - English
I have actually already tried that with no success. Taking a look at the 3rd party headers more module to see if it will help.by Dayo - Nginx Mailing List - English
António P. P. Almeida Wrote: ------------------------------------------------------- > On 19 Jan 2011 19h58 WET, nginx-forum@nginx.us > wrote: > > > I think I am getting closer and hope someone can > nudge me across the > > line. > > > > My set up is now ... > > > > > > if ($http_cookie !~* "mycookie=0") { > > aby Dayo - Nginx Mailing List - English
I think I am getting closer and hope someone can nudge me across the line. My set up is now ... if ($http_cookie !~* "mycookie=0") { add_header Cookie: "mycookie=1"; } The idea being that if mycookie is not 0 (which should cover it not being set), it is set to 1. I then added cookie_MYCOOKIE to the bypass and no cache parameters so that if it is set to 1, theyby Dayo - Nginx Mailing List - English
Dayo Wrote: > ... but will not appreciate some advice on why my > add header is not working "Will now ..." that is!by Dayo - Nginx Mailing List - English
Dayo Wrote: ------------------------------------------------------- > Hi all > > I doesn't seem that "if ($cookie_COOKIE = "") {" > is a valid test for the presence of a cookie as > the code in the if statement does not seem to be > run. > > I am using ... > > > if ($cookie_COOKIE = "") { > add_header Set-Cookie: &qby Dayo - Nginx Mailing List - English
ps I did change "$cookie_COOKIE" to match my cookie name. Thanksby Dayo - Nginx Mailing List - English
Hi all I doesn't seem that "if ($cookie_COOKIE = "") {" is a valid test for the presence of a cookie as the code in the if statement does not seem to be run. I am using ... if ($cookie_COOKIE = "") { add_header Set-Cookie: "hits = 1"; } ... but no joy. (I tried the original suggestion first) Open to further suggestions Thanksby Dayo - Nginx Mailing List - English
Hmmm. That might work. I'll give it a shot.by Dayo - Nginx Mailing List - English