Advertisement
nubilfi

default

Oct 23rd, 2015
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. server {
  2. listen 80 default_server;
  3. listen [::]:80 default_server;
  4.  
  5. root /usr/share/nginx/html;
  6.  
  7. # Add index.php to the list if you are using PHP
  8. index index.html index.php index.htm index.nginx-debian.html;
  9.  
  10. server_name localhost;
  11.  
  12. location / {
  13. autoindex on;
  14. # First attempt to serve request as file, then
  15. # as directory, then fall back to displaying a 404.
  16. try_files $uri $uri/ /index.html;
  17. }
  18.  
  19. error_page 500 502 503 504 /50x.html;
  20. location = /50x.html {
  21. root /usr/share/nginx/html;
  22. }
  23. if (!-e $request_filename) {
  24. rewrite ^(.+)$ /index.php?q=$1 last;
  25. }
  26.  
  27. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  28. #
  29. location ~ \.php$ {
  30. try_files $uri =404;
  31. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  32. # include snippets/fastcgi-php.conf;
  33. #
  34. # # With php5-cgi alone:
  35. # fastcgi_pass 127.0.0.1:9000;
  36. # # With php5-fpm:
  37. fastcgi_pass unix:/var/run/php5-fpm.sock;
  38. fastcgi_index index.php;
  39. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  40. include fastcgi_params;
  41.  
  42. location ~ /\.ht {
  43. deny all;
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement