Guest User

Untitled

a guest
Mar 22nd, 2015
219
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. root@vm1:~# cat /etc/nginx/sites-enabled/server.com.ua
  2. server {
  3.  
  4. listen 80;
  5. server_name server.com.ua ;
  6. index index.php index.html;
  7. root /var/www/server;
  8.  
  9. location ~* ^.+\.(jpe?g|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|ttf|js|swf|avi|mp3|html|htm|xml)$ {
  10. expires 30d;
  11. }
  12.  
  13. error_log /var/log/nginx/error.log;
  14.  
  15. location /admin {
  16. auth_basic "Unauthorized"; # текст сообщения сервера с предложением ввести пароль
  17. auth_basic_user_file /var/www/server/admin/.htpasswd; # путь к htpasswd файлу
  18. }
  19.  
  20.  
  21. location ~ .php$ {
  22. # fastcgi_pass 127.0.0.1:7777;
  23. fastcgi_pass unix:/var/run/php5-fpm.sock;
  24. fastcgi_index index.php;
  25. fastcgi_param SCRIPT_FILENAME /var/www/server/$fastcgi_script_name;
  26. fastcgi_connect_timeout 30;
  27. fastcgi_send_timeout 150;
  28. fastcgi_read_timeout 150;
  29. fastcgi_buffer_size 128k;
  30. fastcgi_buffers 256 16k;
  31. fastcgi_busy_buffers_size 256k;
  32. fastcgi_temp_file_write_size 256k;
  33. include fastcgi_params;
  34. }
  35.  
  36. location /status {
  37. auth_basic_user_file /var/www/server/admin/.htpasswd;
  38. auth_basic "Password-protected Area";
  39. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  40. include fastcgi_params;
  41. fastcgi_pass unix:/var/run/php5-fpm.sock;
  42. # fastcgi_pass 127.0.0.1:9003;
  43.  
  44. }
  45.  
  46.  
  47. # location ~ \.php$ {
  48. # # fastcgi_split_path_info ^(.+\.php)(.*)$;
  49. # fastcgi_pass unix:/var/run/php5-fpm.sock;
  50. # fastcgi_index index.php;
  51. #
  52. # fastcgi_param SCRIPT_FILENAME /var/www/server$fastcgi_script_name;
  53. #
  54. # include fastcgi_params;
  55. # fastcgi_param QUERY_STRING $query_string;
  56. # fastcgi_param REQUEST_METHOD $request_method;
  57. # fastcgi_param CONTENT_TYPE $content_type;
  58. # fastcgi_param CONTENT_LENGTH $content_length;
  59. # fastcgi_intercept_errors on;
  60. # fastcgi_ignore_client_abort off;
  61. # fastcgi_connect_timeout 60;
  62. # fastcgi_send_timeout 180;
  63. ### fastcgi_read_timeout 180;
  64. # fastcgi_buffer_size 128k;
  65. # fastcgi_buffers 4 256k;
  66. # fastcgi_busy_buffers_size 256k;
  67. # fastcgi_temp_file_write_size 256k;
  68. # }
  69.  
  70.  
  71.  
  72. location ~ /\.ht {
  73. deny all;
  74. }
  75. }
RAW Paste Data