9 messages in ru.sysoev.nginxDid I got try_files wrong? and bad ga...
FromSent OnAttachments
Tobias LottJul 5, 2009 8:37 pm 
Michael ShadleJul 5, 2009 9:39 pm 
Tobias LottJul 6, 2009 3:03 am 
Michael ShadleJul 6, 2009 1:29 pm 
Tobias LottJul 6, 2009 2:51 pm 
merlin coreyJul 6, 2009 5:53 pm 
Maxim DouninJul 6, 2009 7:05 pm 
Tobias LottJul 7, 2009 2:51 pm 
Igor SysoevJul 8, 2009 6:33 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Did I got try_files wrong? and bad gateway 502Actions...
From:Tobias Lott (tlo@gamesnet.de)
Date:Jul 5, 2009 8:37:04 pm
List:ru.sysoev.nginx

Hey Folks

I got a problem understanding try_files I guess.

Got this as configuration :

location = / { rewrite ^(.*)$ /shop/ redirect; }

location / { proxy_pass http://backend:10060; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 120; }

Problem is that I cant "catch" all 404 and rewrite it to /shop/index.php but with "if" (which I shouldn't use cause of possible performance issues, Igor mentioned I think.)

Doesn't work: try_files $uri $uri/ /shop/index.php; error_page 404 /shop/index.php;

Works: if (!-f $request_filename) { rewrite ^(.*)$ /shop/index.php redirect; }

Additionally I got another issue, which is that customers getting 502s pretty damn randomly (using nginx-0.7.61 as frontend and apache 2.2.11 as backend for the time being, which gonna gets migrated soon). Was trying to tweak a lil with proxy_*_timeout and keepalive_timeout but since its not reproducible I can't be sure its fixed, are there some "good to go" values or another option to check?

Thanks so much Igor for that godly piece of software and all involved.

Greetings