Skip to content

Instantly share code, notes, and snippets.

@faustman
Last active December 12, 2015 12:09
Show Gist options
  • Select an option

  • Save faustman/4770362 to your computer and use it in GitHub Desktop.

Select an option

Save faustman/4770362 to your computer and use it in GitHub Desktop.

Revisions

  1. Titar Andrey revised this gist Feb 12, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,6 @@
    server {
    listen 80;
    server_name *.domain.com;
    if ($host ~* ^([a-z0-9-\.]+)\.domain\.com$) { set $domain $1; }
    rewrite ^ http://domain.com/?utm_source=$domain&utm_medium=$date_gmt permanent;
    if ($host ~* ^([a-z0-9-\.]+)\.domain\.com$) { set $subdomain $1; }
    rewrite ^ http://domain.com/?utm_source=$subdomain&utm_medium=$date_gmt permanent;
    }
  2. Titar Andrey revised this gist Feb 12, 2013. 2 changed files with 8 additions and 6 deletions.
    6 changes: 0 additions & 6 deletions domain.conf
    Original file line number Diff line number Diff line change
    @@ -1,6 +0,0 @@
    server {
    listen 80;
    server_name *.domain.com;
    if ($host ~* ^([a-z0-9-\.]+)\.domain\.com$) { set $domain $1; }
    rewrite ^ http://domain.com/?utm_source=$domain&utm_medium=$date_gmt permanent;
    }
    8 changes: 8 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    # Redirect http://test.domain.com to http://domain.com/?utm_source=test&utm_medium=423525

    server {
    listen 80;
    server_name *.domain.com;
    if ($host ~* ^([a-z0-9-\.]+)\.domain\.com$) { set $domain $1; }
    rewrite ^ http://domain.com/?utm_source=$domain&utm_medium=$date_gmt permanent;
    }
  3. Titar Andrey created this gist Feb 12, 2013.
    6 changes: 6 additions & 0 deletions domain.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    server {
    listen 80;
    server_name *.domain.com;
    if ($host ~* ^([a-z0-9-\.]+)\.domain\.com$) { set $domain $1; }
    rewrite ^ http://domain.com/?utm_source=$domain&utm_medium=$date_gmt permanent;
    }