From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS33070 50.56.128.0/17 X-Spam-Status: No, score=-0.2 required=5.0 tests=AWL shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: archivist@yhbt.net Delivered-To: archivist@dcvr.yhbt.net Received: from rubyforge.org (50-56-192-79.static.cloud-ips.com [50.56.192.79]) by dcvr.yhbt.net (Postfix) with ESMTP id 83DD51F7A9 for ; Tue, 28 Feb 2012 21:13:21 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id D410D263026; Tue, 28 Feb 2012 21:13:20 +0000 (UTC) X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by rubyforge.org (Postfix) with ESMTP id 09B51263026 for ; Tue, 28 Feb 2012 21:01:37 +0000 (UTC) Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 763421F521; Tue, 28 Feb 2012 21:01:37 +0000 (UTC) Date: Tue, 28 Feb 2012 13:01:37 -0800 From: Eric Wong To: unicorn list Subject: Re: Suggestion for improvement of examples/nginx.conf Message-ID: <20120228210136.GA2808@dcvr.yhbt.net> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: mongrel-unicorn@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: mongrel-unicorn-bounces@rubyforge.org Errors-To: mongrel-unicorn-bounces@rubyforge.org Eike Herzbach wrote: > Hi, > > what do you think about that: > > diff --git a/examples/nginx.conf b/examples/nginx.conf > index cc1038a..5ef43f3 100644 > --- a/examples/nginx.conf > +++ b/examples/nginx.conf > @@ -55,7 +55,7 @@ http { > # faster or not than doing compression via nginx. It's easier > # to configure it all in one place here for static files and also > # to disable gzip for clients who don't get gzip/deflate right. > - # There are other other gzip settings that may be needed used to deal with > + # There are other gzip settings that may be needed used to deal with Obviously correct, will apply. Thanks. > - # enable this if and only if you use HTTPS, this helps Rack > + # enable this if you use HTTPS, this helps Rack > # set the proper protocol for doing redirects: > - # proxy_set_header X-Forwarded-Proto https; > + # proxy_set_header X-Forwarded-Proto $scheme; > > # pass the Host: header from the client right along so redirects > # can be set properly within the Rack application > > I haven't found an easy way to only set the header if the scheme is > https, but I don't see any problems in sending the header for all > requests either. Setting it for all requests uses an extra hash slot and leads to extra method dispatches in Rack (and possibly code elsewhere). I suppose it doesn't matter for most setups, though. How about this? --- a/examples/nginx.conf +++ b/examples/nginx.conf @@ -120,9 +120,9 @@ http { # http://en.wikipedia.org/wiki/X-Forwarded-For proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # enable this if and only if you use HTTPS, this helps Rack - # set the proper protocol for doing redirects: - # proxy_set_header X-Forwarded-Proto https; + # enable this if you forward HTTPS traffic to unicorn, + # this helps Rack set the proper URL scheme for doing redirects: + # proxy_set_header X-Forwarded-Proto $scheme; # pass the Host: header from the client right along so redirects # can be set properly within the Rack application _______________________________________________ Unicorn mailing list - mongrel-unicorn@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-unicorn Do not quote signatures (like this one) or top post when replying