Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. # Serving from home directories
  2. # With Nginx + PHP5-fpm
  3. #
  4. # NOTE: The order of these blocks CANNOT be changed
  5. #
  6. # Stephen J Radachy <sjradach@mtu.edu>
  7.  
  8. # Enable PHP within home directories
  9. location ~ ^/~(.+?)(/.*\.php)$ {
  10. alias /home/$1/public_html;
  11. autoindex on;
  12. include fastcgi_params;
  13. try_files $2 = 404;
  14. fastcgi_pass unix:/var/run/php5-fpm.sock;
  15. fastcgi_index index.php;
  16. }
  17.  
  18. # Enable PHP on entire site
  19. location ~ \.php$ {
  20. try_files $uri = 404;
  21. fastcgi_pass unix:/var/run/php5-fpm.sock;
  22. fastcgi_index index.php;
  23. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  24. include fastcgi_params;
  25. }
  26.  
  27. # Enable serves from home directories
  28. location ~ ^/~(.+?)(/.*)?$ {
  29. alias /home/$1/public_html$2;
  30. index index.html index.htm index.php;
  31. autoindex on;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement