Skip to content

Instantly share code, notes, and snippets.

@yangg
Created March 26, 2012 05:29

Revisions

  1. yangg revised this gist Sep 24, 2013. 3 changed files with 37 additions and 4 deletions.
    32 changes: 32 additions & 0 deletions dev.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@

    server {
    root /home/brook/Public/$host;

    location / {
    # default_server
    if (!-d /home/brook/Public/$host) {
    proxy_pass http://localhost;
    break;
    }
    proxy_redirect off;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    location ~ \.php$ {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    include fastcgi_params;
    }
    }

    server {
    server_name localhost;
    root /home/brook/Public/localhost;

    location /download {
    autoindex on;
    autoindex_exact_size off;
    }
    }

    # vim: ft=nginx
    2 changes: 1 addition & 1 deletion nginx.conf
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    http {
    # default_type text/plain;
    charset utf-8;
    index index.php index.html;
    # default_type text/plain;

    server {
    # listen 80; ## listen for ipv4; this line is default and implied
    7 changes: 4 additions & 3 deletions reverse-proxy.conf
    Original file line number Diff line number Diff line change
    @@ -5,8 +5,9 @@ server {
    location / {
    proxy_pass http://192.168.10.113:10100;
    proxy_redirect off;
    # proxy_set_header Host $host
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for;
    # proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
    }

    # vim: ft=nginx
  2. yangg revised this gist Jan 24, 2013. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -11,3 +11,9 @@ http {
    }
    # http://wiki.nginx.org/Modules
    # http://wiki.nginx.org/HttpCoreModule


    # get php-fpm to listen on the correct host/port. In /etc/php5/fpm/pool.d/www.conf change the following line from:
    # listen = /var/run/php5-fpm.sock
    # To:
    # listen = 127.0.0.1:9000
  3. yangg revised this gist Apr 9, 2012. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions reverse-proxy.conf
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,7 @@ server {
    location / {
    proxy_pass http://192.168.10.113:10100;
    proxy_redirect off;
    # proxy_set_header Host $host
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for;
    }
  4. yangg revised this gist Apr 7, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion subdomain.conf
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ server {
    }

    server {
    server_name ~^(.*)\.uedsky\.com$;
    server_name ~^(.*)\.uedsky\.com$;
    # if directory doesn't exist
    if (!-d /var/www/uedsky/$1) {
    rewrite . http://uedsky.com/ redirect;
  5. yangg revised this gist Apr 7, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion reverse-proxy.conf
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    server {
    listen 10100;
    # sever_name domain.com;
    # server_name domain.com;

    location / {
    proxy_pass http://192.168.10.113:10100;
  6. yangg revised this gist Apr 7, 2012. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -9,3 +9,5 @@ http {
    root /var/www/$host;
    }
    }
    # http://wiki.nginx.org/Modules
    # http://wiki.nginx.org/HttpCoreModule
  7. yangg revised this gist Apr 5, 2012. 2 changed files with 11 additions and 3 deletions.
    11 changes: 11 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    http {
    charset utf-8;
    index index.php index.html;
    # default_type text/plain;

    server {
    # listen 80; ## listen for ipv4; this line is default and implied
    server_name _;
    root /var/www/$host;
    }
    }
    3 changes: 0 additions & 3 deletions subdomain.conf
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,9 @@
    server {
    listen 80;
    server_name uedsky.com www.uedsky.com;
    root /var/www/uedsky;
    }

    server {
    listen 80;
    server_name ~^(.*)\.uedsky\.com$;
    # if directory doesn't exist
    if (!-d /var/www/uedsky/$1) {
    @@ -15,7 +13,6 @@ server {
    }

    # server {
    # listen 80;
    # server_name www.uedsky.com;
    # rewrite ^/(.*) http://uedsky.com/$1 permanent;
    # }
  8. yangg revised this gist Mar 26, 2012. 1 changed file with 3 additions and 4 deletions.
    7 changes: 3 additions & 4 deletions subdomain.conf
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@

    server {
    listen 80;
    server_name uedsky.com www.uedsky.com;
    @@ -8,11 +7,11 @@ server {
    server {
    listen 80;
    server_name ~^(.*)\.uedsky\.com$;
    #if directory doesn't exist
    # if directory doesn't exist
    if (!-d /var/www/uedsky/$1) {
    rewrite . http://nginxdomain.com/ redirect;
    rewrite . http://uedsky.com/ redirect;
    }
    root /home/domains/nginxdomain.com/public/$1;
    root /var/www/uedsky/$1;
    }

    # server {
  9. yangg created this gist Mar 26, 2012.
    11 changes: 11 additions & 0 deletions reverse-proxy.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    server {
    listen 10100;
    # sever_name domain.com;

    location / {
    proxy_pass http://192.168.10.113:10100;
    proxy_redirect off;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for;
    }
    }
    22 changes: 22 additions & 0 deletions subdomain.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@

    server {
    listen 80;
    server_name uedsky.com www.uedsky.com;
    root /var/www/uedsky;
    }

    server {
    listen 80;
    server_name ~^(.*)\.uedsky\.com$;
    #if directory doesn't exist
    if (!-d /var/www/uedsky/$1) {
    rewrite . http://nginxdomain.com/ redirect;
    }
    root /home/domains/nginxdomain.com/public/$1;
    }

    # server {
    # listen 80;
    # server_name www.uedsky.com;
    # rewrite ^/(.*) http://uedsky.com/$1 permanent;
    # }