Advertisement
matriphe

Nginx config basic virtual host

Feb 18th, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. server {
  2. listen 80;
  3. server_name server.name.domain;
  4. root /path/to/directory/root;
  5.  
  6. access_log off; # or you can use /path/to/file.log
  7. error_log off;
  8.  
  9. location / {
  10. index index.php index.html index.htm;
  11.  
  12. # REWRITE
  13. if (-e $request_filename) {
  14. break;
  15. }
  16.  
  17. if (!-e $request_filename) {
  18. rewrite ^(.*)$ /index.php?q=$1 last;
  19. }
  20. }
  21.  
  22. location ~ \.php$ {
  23. fastcgi_pass 127.0.0.1:9000; # or use your default PHP-fpm setting
  24. fastcgi_index index.php;
  25. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  26. include fastcgi_params;
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement