Advertisement
rei0d

default.conf from conf.d

Mar 3rd, 2015
488
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. #
  2. # The default server
  3. #
  4. server {
  5. listen 80 default_server;
  6. server_name 213.165.xx.xx;
  7.  
  8. #charset koi8-r;
  9.  
  10. #access_log logs/host.access.log main;
  11.  
  12. # Load configuration files for the default server block.
  13. include /etc/nginx/default.d/*.conf;
  14.  
  15. location / {
  16. root /var/www/wordpress;
  17. index index.html index.htm index.php;
  18.  
  19. try_files $uri $uri/ /index.php?q=$request_uri;
  20.  
  21. }
  22.  
  23. location /admin {
  24. auth_basic "Administrator Login";
  25. auth_basic_user_file /var/www/admin/.htpasswd;
  26. }
  27.  
  28. #!!! IMPORTANT !!! We need to hide the password file from prying eyes
  29. # This will deny access to any hidden file (beginning with a .period)
  30. location ~ /\. { deny all; }
  31.  
  32. error_page 404 /404.html;
  33. location = /404.html {
  34. root /usr/share/nginx/html;
  35. }
  36.  
  37. # redirect server error pages to the static page /50x.html
  38. #
  39. error_page 500 502 503 504 /50x.html;
  40. location = /50x.html {
  41. root /usr/share/nginx/html;
  42. }
  43.  
  44.  
  45. # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  46. #
  47. #location ~ \.php$ {
  48. # proxy_pass http://127.0.0.1;
  49. #}
  50.  
  51. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  52. #
  53. location ~ \.php$ {
  54. root /var/www/wordpress;
  55. fastcgi_pass 127.0.0.1:9000;
  56. fastcgi_index index.php;
  57. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  58. include fastcgi_params;
  59. }
  60.  
  61. # deny access to .htaccess files, if Apache's document root
  62. # concurs with nginx's one
  63. #
  64. #location ~ /\.ht {
  65. # deny all;
  66. #}
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement