Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pelligrag/3159803a20f59d559f01cdbb2fb1380b to your computer and use it in GitHub Desktop.
Save pelligrag/3159803a20f59d559f01cdbb2fb1380b to your computer and use it in GitHub Desktop.

Revisions

  1. @section-io-gists section-io-gists revised this gist May 9, 2017. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions ForceHTTPSVarnish4.vcl
    Original file line number Diff line number Diff line change
    @@ -10,4 +10,8 @@ sub vcl_synth {
    set resp.status = 301;
    return(deliver);
    }
    }

    sub vcl_hash {
    hash_data(req.http.X-Forwarded-Proto);
    }
  2. @section-io-gists section-io-gists revised this gist May 9, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ForceHTTPSVarnish4.vcl
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    sub vcl_recv {
    if (req.http.X-Forwarded-For !~ "https") {
    if (req.http.X-Forwarded-Proto !~ "https") {
    return (synth(850, "Moved Permanently"));
    }
    }
  3. @section-io-gists section-io-gists renamed this gist Apr 26, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. @section-io-gists section-io-gists created this gist Apr 26, 2017.
    13 changes: 13 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    sub vcl_recv {
    if (req.http.X-Forwarded-For !~ "https") {
    return (synth(850, "Moved Permanently"));
    }
    }

    sub vcl_synth {
    if(resp.status == 850) {
    set resp.http.Location = "https://" + req.http.host + req.url;
    set resp.status = 301;
    return(deliver);
    }
    }