Skip to content

Instantly share code, notes, and snippets.

@v1nc3ntlaw
Forked from kakipo/webapp.conf
Created July 9, 2017 13:46
Show Gist options
  • Save v1nc3ntlaw/6696d0bfa9069f9c0a8142fab7fc0c78 to your computer and use it in GitHub Desktop.
Save v1nc3ntlaw/6696d0bfa9069f9c0a8142fab7fc0c78 to your computer and use it in GitHub Desktop.

Revisions

  1. @kakipo kakipo revised this gist Mar 12, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion webapp.conf
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ if ($http_x_forwarded_proto != 'https') {
    if ($http_user_agent !~* ELB-HealthChecker) {
    set $redirect "${redirect}1";
    }
    if ($http_host ~ "smarthr.jp") {
    if ($http_host ~ "your-nifty-domain.com") {
    set $redirect "${redirect}1";
    }
    if ($redirect = "111") {
  2. @kakipo kakipo created this gist Mar 12, 2015.
    14 changes: 14 additions & 0 deletions webapp.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    # redirect http to https
    set $redirect "";
    if ($http_x_forwarded_proto != 'https') {
    set $redirect "1";
    }
    if ($http_user_agent !~* ELB-HealthChecker) {
    set $redirect "${redirect}1";
    }
    if ($http_host ~ "smarthr.jp") {
    set $redirect "${redirect}1";
    }
    if ($redirect = "111") {
    rewrite ^ https://$host$request_uri? permanent;
    }