Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. server {
  2. # some configs
  3.  
  4. location = / {
  5. index index.html;
  6. fastcgi_index index.html;
  7. }
  8. or
  9. location / {
  10. index index.html;
  11. fastcgi_index index.html;
  12. }
  13.  
  14. }
  15.  
  16. location ~ .*(css|htc|js|bmp|jp?g|gif|ico|cur|png|swf|htm?|html)$ {
  17. access_log off;
  18. root $www_root;
  19. }
  20.  
  21. location ~ .php$
  22. {
  23. include /etc/nginx/fastcgi_params;
  24. index index.html;
  25. fastcgi_index index.html;
  26. fastcgi_param SCRIPT_FILENAME $www_root$fastcgi_script_name;
  27. fastcgi_param QUERY_STRING $query_string;
  28. fastcgi_param PATH_INFO $fastcgi_path_info;
  29. fastcgi_pass 127.0.0.1:9000;
  30. # Директива определяет что ответы FastCGI-сервера с кодом больше или равные 400
  31. # перенаправлять на обработку nginx'у с помощью директивы error_page
  32. fastcgi_intercept_errors on;
  33. break;
  34. }
  35.  
  36. location ~ /.ht {
  37. deny all;
  38. }
  39.  
  40. location / {
  41. try_files $uri $uri/index.html;
  42. }
  43.  
  44. root /srv/www/ducklington.org/public_html;
  45.  
  46. location = / {
  47. index index.html;
  48.  
  49. location = /index.html {
  50.  
  51. root /www/my-root;
  52.  
  53. # http://example.org
  54. # = means exact location
  55. location = / {
  56. try_files /index.html =404;
  57. }
  58.  
  59. # disable http://example.org/index as a duplicate content
  60. location = /index { return 404; }
  61.  
  62. # This is a general location.
  63. # (e.g. http://example.org/contacts <- contacts.html)
  64. location / {
  65. # use fastcgi or whatever you need here
  66. # return 404 if doesn't exist
  67. try_files $uri.html =404;
  68. }
  69.  
  70. error_log /var/log/nginx/debug.log debug;
  71.  
  72. location / {
  73. try_files $uri $uri/index.html index.html;
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement