Advertisement
Guest User

Untitled

a guest
Sep 5th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. user www-data;
  2. worker_processes 2;
  3. pid /run/nginx.pid;
  4.  
  5. events {
  6. worker_connections 768;
  7. # multi_accept on;
  8. }
  9.  
  10. http {
  11.  
  12. ##
  13. # Basic Settings
  14. ##
  15.  
  16. sendfile on;
  17. tcp_nopush on;
  18. tcp_nodelay on;
  19. keepalive_timeout 30;
  20. types_hash_max_size 2048;
  21. server_tokens off;
  22.  
  23. client_body_buffer_size 1K;
  24. client_header_buffer_size 1k;
  25. client_max_body_size 1m;
  26. large_client_header_buffers 2 1k;
  27.  
  28. client_body_timeout 10;
  29. client_header_timeout 10;
  30. send_timeout 10;
  31.  
  32. # server_names_hash_bucket_size 64;
  33. # server_name_in_redirect off;
  34.  
  35. include /etc/nginx/mime.types;
  36. default_type application/octet-stream;
  37.  
  38. ##
  39. # Logging Settings
  40. ##
  41.  
  42. access_log off;
  43. error_log /var/log/nginx/error.log crit;
  44.  
  45. ##
  46. # Gzip Settings
  47. ##
  48.  
  49. gzip on;
  50. gzip_disable "msie6";
  51.  
  52. # gzip_vary on;
  53. # gzip_proxied any;
  54. # gzip_comp_level 6;
  55. # gzip_buffers 16 8k;
  56. # gzip_http_version 1.1;
  57. # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
  58.  
  59. ##
  60. # nginx-naxsi config
  61. ##
  62. # Uncomment it if you installed nginx-naxsi
  63. ##
  64.  
  65. #include /etc/nginx/naxsi_core.rules;
  66.  
  67.  
  68. ##
  69. # nginx-passenger config
  70. ##
  71. # Uncomment it if you installed nginx-passenger
  72. ##
  73.  
  74. #passenger_root /usr;
  75. #passenger_ruby /usr/bin/ruby;
  76.  
  77. ##
  78. # Virtual Host Configs
  79. ##
  80.  
  81. include /etc/nginx/conf.d/*.conf;
  82. include /etc/nginx/sites-available/*;
  83. }
  84.  
  85.  
  86. ///// Файл из sites-available для сайта
  87. server {
  88. listen 80 default_server;
  89. listen [::]:80 default_server ipv6only=on;
  90.  
  91. root /www/sitefolder;
  92. index index.php index.html index.htm;
  93.  
  94. server_name www.example.com example.com;
  95.  
  96. location / {
  97. # First attempt to serve request as file, then
  98. # as directory, then fall back to displaying a 404.
  99. try_files $uri $uri/ =404;
  100. rewrite ^/(fresh|best|rand|my|search|profile|newstory|added|logout|setnickname)$ /app.php?view=$1 last;
  101. rewrite ^/story/(.*)$ /app.php?story=$1 last;
  102. rewrite ^/main /index.php last;
  103. # Uncomment to enable naxsi on this location
  104. # include /etc/nginx/naxsi.rules
  105. }
  106.  
  107. #location ~* .(jpg|jpeg|png|gif|ico|css|js)$ {
  108. # expires 365d;
  109. #}
  110.  
  111. error_page 404 /404.html;
  112. error_page 500 502 503 504 /50x.html;
  113. location = /50x.html {
  114. root /usr/share/nginx/html;
  115. }
  116.  
  117. location ~* \.(css|js|png|gif|jpg)$ {
  118. expires max;
  119. }
  120.  
  121.  
  122. location ~ \.tpl$ {
  123. deny all;
  124. }
  125.  
  126. location ~ \.php$ {
  127. try_files $uri =404;
  128. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  129. fastcgi_pass unix:/var/run/php5-fpm.sock;
  130. fastcgi_index index.php;
  131. include fastcgi_params;
  132. }
  133.  
  134. # deny access to .htaccess files, if Apache's document root
  135. # concurs with nginx's one
  136. #
  137. #location ~ /\.ht {
  138. # deny all;
  139. #}
  140. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement