Skip to content

Instantly share code, notes, and snippets.

@aaroncm
Created November 11, 2011 04:30
Show Gist options
  • Save aaroncm/1357198 to your computer and use it in GitHub Desktop.
Save aaroncm/1357198 to your computer and use it in GitHub Desktop.
nginx config for php and apache-style homedir
location ~ /~([^/]+)(/.*.php)$ {
alias /home/$1/public_html$2;
try_files "" =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /~([^/]+)($|/.*)$ {
alias /home/$1/public_html$2;
autoindex on;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment