Created
March 26, 2012 05:29
-
-
Save yangg/2203177 to your computer and use it in GitHub Desktop.
Nginx Configs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http { | |
# default_type text/plain; | |
charset utf-8; | |
index index.php index.html; | |
server { | |
# listen 80; ## listen for ipv4; this line is default and implied | |
server_name _; | |
root /var/www/$host; | |
} | |
} | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 10100; | |
# server_name domain.com; | |
location / { | |
proxy_pass http://192.168.10.113:10100; | |
proxy_redirect off; | |
# proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
} | |
# vim: ft=nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name uedsky.com www.uedsky.com; | |
root /var/www/uedsky; | |
} | |
server { | |
server_name ~^(.*)\.uedsky\.com$; | |
# if directory doesn't exist | |
if (!-d /var/www/uedsky/$1) { | |
rewrite . http://uedsky.com/ redirect; | |
} | |
root /var/www/uedsky/$1; | |
} | |
# server { | |
# server_name www.uedsky.com; | |
# rewrite ^/(.*) http://uedsky.com/$1 permanent; | |
# } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment