Created
March 5, 2011 13:03
-
-
Save haswalt/856340 to your computer and use it in GitHub Desktop.
nginx config for loading generic php and html websites running php-fpm using wildcard vhosts. "webdev" is the suffix for hosts so to get to the site for example you would use http://example.webdev/
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 .webdev; | |
index index.html index.php; | |
autoindex on; | |
set $root ""; | |
if ($host ~* ^(www\.)?(.+)\.webdev) { | |
set $root $2; | |
} | |
location / { | |
root /Users/harry/Sites/$root/; | |
} | |
location ~ \.php$ { | |
set $script $uri; | |
include fastcgi_params; | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_param SCRIPT_FILENAME /Users/harry/Sites/$root$script; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment