Advertisement
Guest User

Untitled

a guest
May 16th, 2014
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. server {
  2. listen 80;
  3. server_name domain.com;
  4. charset utf-8;
  5.  
  6. root /var/www/project/public;
  7.  
  8. location / {
  9. index index.php;
  10. }
  11.  
  12. # removes trailing slashes (prevents SEO duplicate content issues)
  13. if (!-d $request_filename)
  14. {
  15. rewrite ^/(.+)/$ /$1 permanent;
  16. }
  17.  
  18. # removes trailing "index" from all controllers
  19. if ($request_uri ~* index/?$)
  20. {
  21. rewrite ^/(.*)/index/?$ /$1 permanent;
  22. }
  23.  
  24. # unless the request is for a valid file (image, js, css, etc.), send to bootstrap
  25. if (!-e $request_filename)
  26. {
  27. rewrite ^/(.*)$ /index.php?/$1 last;
  28. break;
  29. }
  30.  
  31. location ~* ^.+\.php$ {
  32. fastcgi_pass unix:/var/run/php5-fpm.sock;
  33. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  34. fastcgi_param DOCUMENT_ROOT $document_root;
  35. include fastcgi_params;
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement