Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.94 KB | None | 0 0
  1.  
  2. server {
  3. #listen 127.0.0.1:3000;
  4. listen 212.20.30.177:8003;
  5. server_name info.sibnet.ru;
  6.  
  7. access_log /home/mark/work/logs/info.access.log;
  8. error_log /home/mark/work/logs/info.error.log notice;
  9.  
  10. root /home/mark/work/newinfo/web;
  11.  
  12. large_client_header_buffers 4 8k;
  13.  
  14. location /who_admin/ {
  15. allow 90.189.192.0/23;
  16. allow 212.20.30.0/24;
  17. deny all;
  18. try_files $uri /app.php$is_args$args;
  19. }
  20.  
  21. location /sibnet-club/ {
  22. allow 90.189.192.0/23;
  23. allow 212.20.30.0/24;
  24. deny all;
  25. try_files $uri /app.php$is_args$args;
  26. }
  27.  
  28. # 301 редирект с путей index.php на / и index.php?query на /?query
  29. # http://redmine.sibnet.ru/issues/10334/
  30. if ($request_uri ~* "^(.*/)index\.php(.*)") {
  31. return 301 $1$2;
  32. }
  33.  
  34. # 301 редирект с путей app.php на / и app.php?query на /?query
  35. if ($request_uri ~* "^(.*/)app\.php(.*)") {
  36. return 301 $1$2;
  37. }
  38.  
  39.  
  40. # gzip json и отдельный лог статики
  41. location ~ \.json$ {
  42. access_log /home/mark/work/logs/info.access.log;
  43. error_log /home/mark/work/logs/info.error.log notice;
  44.  
  45. # нужно для отдачи мобильной погоды
  46. add_header 'Access-Control-Allow-Origin' '*';
  47.  
  48. root /home/mark/work/newinfo/web;
  49. gzip on;
  50. gzip_min_length 1000;
  51. gzip_comp_level 6;
  52. gzip_proxied no-cache;
  53. gzip_types application/json;
  54. }
  55.  
  56. # редиректы для совместимости
  57. location ~ ^(/weather/script_combo.js|/weather/script_combo.css|/weather/img/.*|/images/.*) {
  58. return 301 /legacy$1;
  59. }
  60.  
  61. # gzip статики
  62. location ~ \.(xml|css|js)$ {
  63. access_log /home/mark/work/logs/info.access.log;
  64. error_log /home/mark/work/logs/info.error.log notice;
  65.  
  66. root /home/mark/work/newinfo/web;
  67. gzip on;
  68. gzip_min_length 1000;
  69. gzip_comp_level 6;
  70. gzip_proxied no-cache;
  71. gzip_types text/css text/xml text/js text/javascript application/x-javascript application/javascript application/xml;
  72. add_header Cache-Control "max-age=2629000, public, must-revalidate, proxy-revalidate";
  73. }
  74.  
  75.  
  76.  
  77. # symfony ignore dir
  78. location /legacy {
  79. location /legacy/static_templates {
  80. index index.php index.html index.htm;
  81. }
  82. }
  83.  
  84. # symfony ignore dir
  85. location /adminjs {
  86. index index.php index.html index.htm;
  87. }
  88.  
  89. # symfony ignore dir
  90. location ~ ^/(data|img|js|css|sitemap)/.* {
  91. }
  92.  
  93. # disable access
  94. location ~ ^/(app_dev|config).php(/|$) {
  95. return 404;
  96. }
  97.  
  98. # any path over symfony
  99. location / {
  100. client_max_body_size 200m;
  101. try_files $uri /app.php$is_args$args;
  102. }
  103.  
  104. location /what-in-work/ {
  105. proxy_pass http://192.168.0.211:12801;
  106. proxy_http_version 1.1;
  107. proxy_set_header Upgrade $http_upgrade;
  108. proxy_set_header Connection "upgrade";
  109. }
  110.  
  111. location ~ \.php$ {
  112. access_log /home/mark/work/logs/info.access.log;
  113. error_log /home/mark/work/logs/info.error.log notice;
  114.  
  115. try_files $uri /app.php$is_args$args;
  116.  
  117. # gzip php выдачи
  118. gzip on;
  119. gzip_min_length 1000;
  120. gzip_comp_level 6;
  121. gzip_proxied no-cache;
  122. gzip_types text/plain text/css application/x-javascript application/javascript application/json text/xml application/xml application/xml+rss text/javascript;
  123.  
  124. # upload size
  125. client_max_body_size 200m;
  126.  
  127. fastcgi_pass unix:/run/php/php5.6-fpm.sock;
  128. fastcgi_index index.php;
  129. fastcgi_param SCRIPT_FILENAME /home/mark/work/newinfo/web/$fastcgi_script_name;
  130. fastcgi_param REMOTE_ADDR $remote_addr;
  131. fastcgi_param X-Real-IP $remote_addr;
  132. fastcgi_param X_FORWARDED_FOR $proxy_add_x_forwarded_for;
  133. fastcgi_param QUERY_STRING $query_string;
  134. fastcgi_param REQUEST_METHOD $request_method;
  135. fastcgi_param CONTENT_TYPE $content_type;
  136. fastcgi_param CONTENT_LENGTH $content_length;
  137. fastcgi_param REQUEST_URI $request_uri;
  138. fastcgi_param DOCUMENT_ROOT /home/mark/work/newinfo/web;
  139. fastcgi_param SERVER_NAME info-local.sibnet.ru;
  140. fastcgi_buffer_size 16k;
  141. fastcgi_buffers 10 100k;
  142. fastcgi_intercept_errors on;
  143. }
  144.  
  145. # </GENERATED in attributes/default.rb>
  146.  
  147.  
  148. error_page 500 502 503 504 /50x.html;
  149.  
  150. location ~ (status|ping)$ {
  151. allow 212.20.30.0/24;
  152. allow 90.189.192.0/23;
  153. allow 127.0.0.1;
  154. deny all;
  155. fastcgi_pass unix:/run/php/php5.6-fpm.sock;
  156. include fastcgi.conf;
  157. }
  158.  
  159. location ~ /\.ht {
  160. deny all;
  161. }
  162.  
  163. location ~ /\.svn {
  164. deny all;
  165. }
  166.  
  167. location ~/\.git {
  168. deny all;
  169. }
  170. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement