Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Serving from home directories
- # With Nginx + PHP5-fpm
- #
- # NOTE: The order of these blocks CANNOT be changed
- #
- # Stephen J Radachy <sjradach@mtu.edu>
- # Enable PHP within home directories
- location ~ ^/~(.+?)(/.*\.php)$ {
- alias /home/$1/public_html;
- autoindex on;
- include fastcgi_params;
- try_files $2 = 404;
- fastcgi_pass unix:/var/run/php5-fpm.sock;
- fastcgi_index index.php;
- }
- # Enable PHP on entire site
- location ~ \.php$ {
- try_files $uri = 404;
- fastcgi_pass unix:/var/run/php5-fpm.sock;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
- # Enable serves from home directories
- location ~ ^/~(.+?)(/.*)?$ {
- alias /home/$1/public_html$2;
- index index.html index.htm index.php;
- autoindex on;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement