Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add behind proxy middleware #590

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Commits on May 22, 2014

  1. Plack middleware for request header munging when behind a reverse proxy

    Uses existing plack middlewares (ReverseProxy and ReverseProxyPath) to
    handle all request header modification when operating behing a proxy. Allows
    for variants (eg HTTP_X_FORWARDED_PROTOCOL) supported by Dancer(2) but not
    from those existing ReverseProxy middleware.
    
    Special cases REQUEST_BASE header to work with ReverseProxyPath so proxies
    from/to non-root paths "just work"(tm). (Alternate to #571.)
    
    As a middleware, devs get more flexability as to where to apply it; they can
    use Plack::Builder to wrap this around their app as well as further path/header
    altering middleware. This could be released as a seperate package; its not
    Dancer2 specific.
    veryrusty committed May 22, 2014
    Configuration menu
    Copy the full SHA
    fea1cd0 View commit details
    Browse the repository at this point in the history
  2. Make behind_proxy a global var

    Conditionally apply BehindProxy middleware if behind_proxy is set.
    
    Making the "behind_proxy" option a global trigger that updates the
    Dancer 2::Runner object when
      set behind_proxy => 1;
    is run so the reverse proxy middleware can be conditionally wrapped
    around applications psgi coderef.
    
    We now 'use' the middleware directly rather than letting Placl::Builder
    load it for us. May allow earlier version of Placl to be used as a dependency.
    veryrusty committed May 22, 2014
    Configuration menu
    Copy the full SHA
    5973481 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    26317cc View commit details
    Browse the repository at this point in the history
  4. Update redirect tests

    Includes tests when proxy is not from root (see #571)
    
    Removes tests for ftp as the protocol behing a http proxy - it was silly
    and ReverseProxy middleware doesn't support it.
    veryrusty committed May 22, 2014
    Configuration menu
    Copy the full SHA
    cd44517 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8d45511 View commit details
    Browse the repository at this point in the history