unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: Suggestion for improvement of examples/nginx.conf
Date: Tue, 28 Feb 2012 13:01:37 -0800	[thread overview]
Message-ID: <20120228210136.GA2808@dcvr.yhbt.net> (raw)
In-Reply-To: <CAHQT9biBWBuzApZ6Pjjiny-O0PUNDxQskHihGg4trvgFc1uRAg@mail.gmail.com>

Eike Herzbach <eike@herzbach.net> 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

  reply	other threads:[~2012-02-28 21:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-28 18:34 Suggestion for improvement of examples/nginx.conf Eike Herzbach
2012-02-28 21:01 ` Eric Wong [this message]
2012-03-20 19:59   ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/unicorn/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120228210136.GA2808@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=mongrel-unicorn@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).