Skip to content

Instantly share code, notes, and snippets.

@jianingy
Created April 17, 2013 08:26
Show Gist options
  • Save jianingy/5402680 to your computer and use it in GitHub Desktop.
Save jianingy/5402680 to your computer and use it in GitHub Desktop.
dyanmic virtualhost for nginx
server {
listen 80 default;
listen [::]:80 default;
server_name _;
charset utf-8;
access_log off;
root /var/www/$http_host/wwwroot/;
location / {
index index.html index.htm index.php;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:65534;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment