Advertisement
Guest User

Untitled

a guest
Oct 27th, 2014
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. server {
  2. # listen directive here.
  3. include /etc/nginx/port.conf;
  4. server_name example.com;
  5.  
  6. root /home/path/to/example.com/app/webroot/;
  7. index index.php;
  8. try_files $uri $uri/ index.php;
  9.  
  10. if (-f $request_filename) {
  11. break;
  12. }
  13.  
  14. if (!-f $request_filename) {
  15. rewrite ^/(.+)$ /index.php?url=$1 last;
  16. break;
  17. }
  18.  
  19. location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
  20. expires 1y;
  21. log_not_found off;
  22. }
  23.  
  24. location / {
  25. try_files $uri $uri/ /index.php?$uri&$args;
  26.  
  27. # autoindex on;
  28. types {
  29. text/html html htm shtml;
  30. text/css css;
  31. text/xml xml;
  32. image/gif gif;
  33. image/jpeg jpeg jpg;
  34. }
  35. default_type application/octet-stream;
  36. }
  37.  
  38. location ~ \.php$ {
  39. try_files $uri =404;
  40. include /etc/nginx/fastcgi_params;
  41. fastcgi_pass 127.0.0.1:9000;
  42. fastcgi_read_timeout 30;
  43. fastcgi_index index.php;
  44. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  45. }
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement