6 messages in ru.sysoev.nginxRe: Wonderful one-liners in configura...
FromSent OnAttachments
sbwoodsideApr 29, 2009 10:19 pm 
Igor SysoevApr 29, 2009 10:31 pm 
sbwoodsideMay 15, 2009 7:26 pm 
Michael ShadleMay 15, 2009 7:40 pm 
Igor SysoevMay 15, 2009 9:42 pm 
usen68May 19, 2009 4:48 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:Re: Wonderful one-liners in configurationActions...
From:Igor Sysoev (is@rambler-co.ru)
Date:May 15, 2009 9:42:26 pm
List:ru.sysoev.nginx

On Fri, May 15, 2009 at 10:27:02PM -0400, sbwoodside wrote:

I prefer to not use one-liner in blocks as above since it does not allow to comment out some servers.

Yes... in this case I'll never be commenting out just one that I can think of,
because it's a cluster started by cap.

location / { try_files $uri $uri/index.html $uri.html @mongrel; }

Nice! I've installed nginx from source and switched to this. Here's my config
now (for my redmine instalation)

upstream mongrel-redmine { server 127.0.0.1:9500; server 127.0.0.1:9501; server
127.0.0.1:9502; } server { listen 443; server_name example.com; ssl on; ssl_certificate /etc/nginx/certs/myssl.crt; ssl_certificate_key
/etc/nginx/certs/myssl.key; root /var/www/deployed-redmine/current/public; error_page 500 502 503 504 /50x.html; location = /50x.html { root
/var/www/nginx-default; } if (-f $document_root/system/maintenance.html) { rewrite ^(.*)$
/system/maintenance.html last; break; } location / { try_files $uri $uri/index.html $uri.html @mongrel; }

This

if (-f $document_root/system/maintenance.html) { rewrite ^(.*)$ /system/maintenance.html last; break; } location / { try_files $uri $uri/index.html $uri.html @mongrel; }

should be replaced by

location / { try_files /system/maintenance.html $uri $uri/index.html $uri.html @mongrel; }

location @mongrel { proxy_pass http://mongrel-redmine; proxy_set_header X-FORWARDED_PROTO https; 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; } }

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,1579,2084#msg-2084