Advertisement
Guest User

Untitled

a guest
Mar 26th, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. server {
  2. # Replace this port with the right one for your requirements
  3. listen 80; #could also be 1.2.3.4:80
  4.  
  5. # Multiple hostnames separated by spaces. Replace these as well.
  6. server_name board.local; # Alternately: _
  7.  
  8. root /var/www/html/board/public;
  9.  
  10. #error_page 404 errors/404.html;
  11. #access_log logs/star.yourdomain.com.access.log;
  12.  
  13. index index.php;
  14.  
  15. # serve static files directly
  16. location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
  17. access_log off;
  18. expires max;
  19. log_not_found off;
  20. }
  21.  
  22. # removes trailing slashes (prevents SEO duplicate content issues)
  23. if (!-d $request_filename)
  24. {
  25. rewrite ^/(.+)/$ /$1 permanent;
  26. }
  27.  
  28.  
  29.  
  30. # unless the request is for a valid file (image, js, css, etc.), send to bootstrap
  31. if (!-e $request_filename)
  32. {
  33. rewrite ^/(.*)$ /index.php?/$1 last;
  34. break;
  35. }
  36.  
  37. location / {
  38. try_files $uri $uri/ /index.php?$query_string;
  39. }
  40.  
  41. location ~* \.php$ {
  42. try_files $uri = 404;
  43. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  44. fastcgi_pass unix:/var/run/php5-fpm.sock; # may also be: 127.0.0.1:9000;
  45. fastcgi_index index.php;
  46. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  47. include fastcgi_params;
  48. }
  49.  
  50. location ~ /\.ht {
  51. deny all;
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement