Skip to content

Instantly share code, notes, and snippets.

@yangg
Created March 26, 2012 05:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yangg/2203177 to your computer and use it in GitHub Desktop.
Save yangg/2203177 to your computer and use it in GitHub Desktop.
Nginx Configs
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
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
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
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