Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 17.22 KB | None | 0 0
  1. root@ezemail:/backup/etc/nginx# cat nginx.conf
  2. user apache;
  3. worker_processes  auto;
  4. worker_rlimit_nofile 200000;
  5. worker_priority -10;
  6.  
  7. error_log   /var/log/nginx/error.log;
  8. #error_log  /var/log/nginx/error.log  notice;
  9. #error_log  /var/log/nginx/error.log  info;
  10.  
  11. pid        /var/run/nginx.pid;
  12.  
  13.  
  14. events {
  15.     worker_connections  8192;
  16.     multi_accept        on;
  17.     use epoll;
  18. }
  19.  
  20. http {
  21.     include       /etc/nginx/mime.types;
  22.     default_type  application/octet-stream;
  23.  
  24.     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
  25.                       '$status $body_bytes_sent "$http_referer" '
  26.                       '"$http_user_agent" "$http_x_forwarded_for"';
  27.  
  28.     log_format timed_combined '$remote_addr - $remote_user [$time_local]  '
  29.     '"$request" $status $body_bytes_sent '
  30.     '"$http_referer" "$http_user_agent" '
  31.     '$request_time $upstream_response_time $pipe';
  32.  
  33.             map $http_upgrade $connection_upgrade {
  34.             default upgrade;
  35.             ''      close;
  36.             }
  37.  
  38.     access_log  /var/log/nginx/access.log  timed_combined;
  39.     geoip_city /usr/share/GeoIP/GeoIPCity.dat;
  40.     geoip_country /usr/share/GeoIP/GeoIP.dat;
  41. #    map $geoip_country_code $good_country {
  42. #    default no;
  43. #       RU yes;
  44. #       UA yes;
  45. #       BY yes;
  46. #       KZ yes;
  47. #       MD yes;
  48. #       LT yes;
  49. #       LV yes;
  50. #       UZ yes;
  51. #       KG yes;
  52. #       PL yes;
  53. #       EE yes;
  54. #       IL yes;
  55. #       GE yes;
  56. #       AM yes;
  57. #       }
  58.    map $geoip_city_continent_code $good_country {
  59.         default no;
  60.         AS yes;
  61.         EU yes;
  62. }
  63.  
  64.     open_file_cache max=1000 inactive=20s;
  65.     open_file_cache_valid 30s;
  66.     open_file_cache_min_uses 5;
  67.     open_file_cache_errors off;
  68.     sendfile        on;
  69.     tcp_nopush      on;
  70.     tcp_nodelay     on;
  71.     server_tokens   off;
  72.     gzip            on;
  73.     gzip_static     on;
  74.     gzip_comp_level 9;
  75.     gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
  76.     #gzip_types text/plain;
  77.     gzip_min_length 10240;
  78.     keepalive_timeout  60;
  79.     #keepalive_timeout  600;
  80.     keepalive_requests 100000;
  81.     reset_timedout_connection on;
  82.     client_body_timeout 10;
  83.     send_timeout 2;
  84.  
  85.     proxy_buffering on;
  86.     proxy_buffers 32 512k;
  87.     proxy_buffer_size 512k;
  88.     proxy_intercept_errors on;
  89.     proxy_connect_timeout 120;
  90.     proxy_read_timeout 120;
  91.     proxy_send_timeout 120;
  92.  
  93.     limit_conn_zone   $binary_remote_addr  zone=addr:10m;
  94.  
  95.     # Load config files from the /etc/nginx/conf.d directory
  96.     include /etc/nginx/conf.d/*.conf;
  97.  
  98.     #####USERBARS ISENGARD CACHE#####
  99.     proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:16m;
  100.  
  101.     # another virtual host using mix of IP-, name-, and port-based configuration
  102.     #
  103.     #server {
  104.     #    listen       8000;
  105.     #    listen       somename:8080;
  106.     #    server_name  somename  alias  another.alias;
  107.  
  108.     #    location / {
  109.     #        root   html;
  110.     #        index  index.html index.htm;
  111.     #    }
  112.     #}
  113.  
  114.     #####STUB#####
  115.     #server {
  116.     #   listen *:8899;
  117.     #   server_name stub;
  118.     #
  119.     #   location /
  120.     #   {
  121.     #       stub_status on;
  122.     #       access_log off;
  123.     #   }
  124.     #}
  125.  
  126.     # HTTPS server
  127.     #
  128.     #server {
  129.     #    listen       443 ssl;
  130.     #    server_name  localhost;
  131.  
  132.     #    ssl_certificate      cert.pem;
  133.     #    ssl_certificate_key  cert.key;
  134.  
  135.     #    ssl_session_cache    shared:SSL:1m;
  136.     #    ssl_session_timeout  5m;
  137.  
  138.     #    ssl_ciphers  HIGH:!aNULL:!MD5;
  139.     #    ssl_prefer_server_ciphers  on;
  140.  
  141.     #    location / {
  142.     #        root   html;
  143.     #        index  index.html index.htm;
  144.     #    }
  145.     #}
  146.  
  147.         include /usr/local/ispmgr/etc/nginx.domain;
  148.         client_max_body_size 64M;
  149.         log_format isp '$bytes_sent $request_length';
  150.         limit_req_zone $binary_remote_addr zone=isengard-limit:32m rate=40r/s;
  151.         limit_conn_zone $binary_remote_addr zone=isengard:10m;
  152.         server {
  153.                 server_name ezwow.org www.ezwow.org;
  154.                 listen 91.202.44.222;
  155.                 listen 91.202.44.222:443 ssl;
  156.                 disable_symlinks if_not_owner from=$root_path;
  157.  
  158.                 set_real_ip_from 185.121.240.32/27;
  159.                 set_real_ip_from 185.121.241.16/29;
  160.                 #real_ip_header X-Forwarded-For;
  161.                 real_ip_header X-Real-IP;
  162.  
  163.                 set $root_path /var/www/isengard/data/www/ezwow.org;
  164.                 add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
  165.                 location ~* ^\/.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf|svg|ttf|woff|woff2|otf|eot|ico|rtf|doc|txt)$ {
  166.                         root $root_path;
  167.                         expires      7d;
  168.                         access_log /var/www/nginx-logs/isengard isp;
  169.                         access_log /var/www/httpd-logs/ezwow.org.access.log ;
  170.                         #access_log   off;
  171.                         error_page 404 = @fallback;
  172.                 }
  173.                 location / {
  174.                         proxy_pass http://91.202.44.222:81;
  175.                         proxy_redirect http://91.202.44.222:81/ /;
  176.                         proxy_set_header Host $host;
  177.                         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  178.                         proxy_set_header X-Forwarded-Proto $scheme;
  179.                         proxy_set_header X-Real-IP $remote_addr;
  180. #                       if ($http_user_agent ~* "googlebot|google|yahoo|bingbot|baiduspider|yandex|yandexbot|mail.ru_bot|Yandex.Money|yeti|yodaobot|gigabot|ia_archiver|facebookexternalhit|twitterbot|developers\.google\.com|archive.org_bot") {
  181. #                            set $good_country yes;
  182. #                            }
  183. #                       if ($remote_addr ~ ^10\.2\.) {
  184. #                            set $good_country yes;
  185. #                            }
  186. #                        if ($good_country = no){
  187. #                            #rewrite     ^ http://cactus-net.ru/block.html;
  188. #                            return 404;
  189. #                            }
  190.                 }
  191.                 location ~* ^/(webstat|awstats|webmail|myadmin|pgadmin)/ {
  192.                         proxy_pass http://91.202.44.222:81;
  193.                         proxy_redirect http://91.202.44.222:81/ /;
  194.                         proxy_set_header Host $host;
  195.                         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  196.                         proxy_set_header X-Forwarded-Proto $scheme;
  197.                         proxy_set_header X-Real-IP $remote_addr;
  198.                 }
  199.  
  200.                 location @fallback {
  201.                         proxy_pass http://91.202.44.222:81;
  202.                         proxy_set_header Host $host;
  203.                         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  204.                         proxy_set_header X-Forwarded-Proto $scheme;
  205.                         proxy_set_header X-Real-IP $remote_addr;
  206.                 }
  207.  
  208.                 location ^~ /webstat/ {
  209.                         auth_basic "Restricted area";
  210.                         auth_basic_user_file /var/www/isengard/data/etc/208798204.passwd;
  211.                         try_files $uri @fallback;
  212.                 }
  213.  
  214.                 ################КЭШ ЮЗЕРБАРОВ#################
  215.                 location ^~ /userbars {
  216.                         proxy_pass http://91.202.44.222:81;
  217.                         proxy_cache one;
  218.                         proxy_cache_valid 200 24h;
  219.                         proxy_connect_timeout 60s;
  220.                         proxy_cache_use_stale error updating timeout invalid_header http_500 http_502 http_503 http_504;
  221.                         proxy_cache_min_uses 1;
  222.                         proxy_ignore_client_abort off;
  223.                         proxy_hide_header "Set-Cookie";
  224.                         proxy_ignore_headers "Cache-Control" "Expires" "Set-Cookie";
  225.                         proxy_read_timeout 120;
  226.                         proxy_set_header Host $host;
  227.                         expires 2h;
  228.                         #try_files $uri @userbars;
  229.                         #rewrite "^(/userbars)/([a-f0-9]{32})\.png$" $1/userbar.php?hash=$2 last;
  230.                 }
  231.  
  232.                 location = /robots.txt
  233.                 {
  234.                     root $root_path;
  235.                     access_log off;
  236.                     expires      1m;
  237.                     error_page 404 = @fallback;
  238.                 }
  239.  
  240.                 location = /lstat.txt
  241.                 {
  242.                     root $root_path;
  243.                     access_log off;
  244.                     expires      1m;
  245.                     error_page 404 = @fallback;
  246.                 }
  247.  
  248.                 location = /stat.txt
  249.                 {
  250.                     root $root_path;
  251.                     access_log off;
  252.                     expires      1m;
  253.                     error_page 404 = @fallback;
  254.                 }
  255.  
  256.                 location /rss/forums/2-novosti-servera
  257.                 {
  258.                     root $root_path;
  259.                     rewrite ^ /rss/news.xml;
  260.                 }
  261.  
  262.                 location /rss/forums/3-poslednie-temy
  263.                 {
  264.                     root $root_path;
  265.                     rewrite ^ /rss/last_topic.xml;
  266.                 }
  267.  
  268.                 location ^~ /chat/ {
  269.                     root $root_path;
  270.                     access_log off;
  271.                     expires      off;
  272.                     error_page 404 = @fallback;
  273.                 }
  274.  
  275.                 location ^~ /teamspeak/ {
  276.                     proxy_pass http://91.202.44.200:3000/;
  277.                     proxy_connect_timeout       3;
  278.                     proxy_send_timeout          1d;
  279.                     proxy_read_timeout          1d;
  280.                     send_timeout                1d;
  281.  
  282.                     proxy_http_version 1.1;
  283.                     proxy_redirect off;
  284.  
  285.                     proxy_buffers 8 32k;
  286.                     proxy_buffer_size 64k;
  287.  
  288.                     proxy_set_header Upgrade $http_upgrade;
  289.                     proxy_set_header Connection "upgrade";
  290.                     proxy_set_header X-Real-IP $remote_addr;
  291.                     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  292.                     proxy_set_header Host $http_host;
  293.                     proxy_set_header X-NginX-Proxy true;
  294.                     access_log /var/www/httpd-logs/ezwow.org.teamspeak.access.log ;
  295.                     error_log /var/www/httpd-logs/ezwow.org.teamspeak.error.log ;
  296.  
  297.                 }
  298.  
  299.                 location ^~ /promo/ {
  300.                     proxy_pass http://91.202.44.200:3001/;
  301.                     proxy_connect_timeout       3;
  302.                     proxy_send_timeout          1d;
  303.                     proxy_read_timeout          1d;
  304.                     send_timeout                1d;
  305.  
  306.                     auth_basic           "closed site";
  307.                     auth_basic_user_file /var/www/isengard/data/www/ezwow.org/admin/.htpasswd;
  308.  
  309.                     proxy_http_version 1.1;
  310.                     proxy_redirect off;
  311.  
  312.                     proxy_buffers 8 32k;
  313.                     proxy_buffer_size 64k;
  314.  
  315.                     proxy_set_header Upgrade $http_upgrade;
  316.                     proxy_set_header Connection "upgrade";
  317.                     proxy_set_header X-Real-IP $remote_addr;
  318.                     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  319.                     proxy_set_header Host $http_host;
  320.                     proxy_set_header X-NginX-Proxy true;
  321.                 }
  322.  
  323.                 limit_conn isengard 65535;
  324.                 include /usr/local/ispmgr/etc/nginx.inc;
  325.                 ssl_certificate /var/www/httpd-cert/isengard/ezwow.org.chained.crt;
  326.                 ssl_certificate_key /var/www/httpd-cert/isengard/ezwow.org.key;
  327.  
  328.                 if ($ssl_protocol = "") {
  329.                     rewrite ^   https://$server_name$request_uri? permanent;
  330.                 }
  331.         }
  332.         server {
  333.                 server_name ezemail.org www.ezemail.org;
  334.                 listen 91.202.44.195;
  335.                 listen 91.202.44.195:443 ssl;
  336.                 disable_symlinks if_not_owner from=$root_path;
  337.                 set $root_path /var/www/isengard/data/www/ezemail.org;
  338.                 location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
  339.                         root $root_path;
  340.                         access_log /var/www/nginx-logs/isengard isp;
  341.                         access_log /var/www/httpd-logs/ezemail.org.access.log ;
  342.                         error_page 404 = @fallback;
  343.                 }
  344.                 location / {
  345.                         proxy_pass http://91.202.44.195:81;
  346.                         proxy_redirect http://91.202.44.195:81/ /;
  347.                         proxy_set_header Host $host;
  348.                         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  349.                         proxy_set_header X-Forwarded-Proto $scheme;
  350.                         proxy_set_header X-Real-IP $remote_addr;
  351.                 }
  352.                 location ~* ^/(webstat|awstats|webmail|myadmin|pgadmin)/ {
  353.                         proxy_pass http://91.202.44.195:81;
  354.                         proxy_redirect http://91.202.44.195:81/ /;
  355.                         proxy_set_header Host $host;
  356.                         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  357.                         proxy_set_header X-Forwarded-Proto $scheme;
  358.                         proxy_set_header X-Real-IP $remote_addr;
  359.                 }
  360.                 location @fallback {
  361.                         proxy_pass http://91.202.44.195:81;
  362.                         proxy_set_header Host $host;
  363.                         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  364.                         proxy_set_header X-Forwarded-Proto $scheme;
  365.                         proxy_set_header X-Real-IP $remote_addr;
  366.                 }
  367.                 location ^~ /webstat/ {
  368.                         auth_basic "Restricted area";
  369.                         auth_basic_user_file /var/www/isengard/data/etc/209453353.passwd;
  370.                         try_files $uri @fallback;
  371.                 }
  372.                 limit_conn isengard 65535;
  373.                 include /usr/local/ispmgr/etc/nginx.inc;
  374.                 ssl_certificate /var/www/httpd-cert/isengard/ezemail.org.chained.crt;
  375.                 ssl_certificate_key /var/www/httpd-cert/isengard/ezemail.org.key;
  376.         }
  377.  
  378.         limit_req_zone $binary_remote_addr zone=isengard-limitdb:32m rate=40r/s;
  379.         limit_conn_zone $binary_remote_addr zone=isengarddb:10m;
  380.  
  381.         server {
  382.                 server_name db.ezwow.org;
  383.                 listen 91.202.44.222;
  384.                 listen 91.202.44.222:443 ssl;
  385.                 disable_symlinks if_not_owner from=$root_path;
  386.                 set $root_path /var/www/isengard/data/www/db.ezwow.org;
  387.                 location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
  388.                         root $root_path;
  389.                         access_log /var/www/nginx-logs/isengard isp;
  390.                         access_log /var/www/httpd-logs/db.ezwow.org.access.log ;
  391.                         error_page 404 = @fallback;
  392.                 }
  393.                 location / {
  394.                         proxy_pass http://91.202.44.222:81;
  395.                         proxy_redirect http://91.202.44.222:81/ /;
  396.                         proxy_set_header Host $host;
  397.                         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  398.                         proxy_set_header X-Forwarded-Proto $scheme;
  399.                         proxy_set_header X-Real-IP $remote_addr;
  400.                 }
  401.                 location ~* ^/(webstat|awstats|webmail|myadmin|pgadmin)/ {
  402.                         proxy_pass http://91.202.44.222:81;
  403.                         proxy_redirect http://91.202.44.222:81/ /;
  404.                         proxy_set_header Host $host;
  405.                         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  406.                         proxy_set_header X-Forwarded-Proto $scheme;
  407.                         proxy_set_header X-Real-IP $remote_addr;
  408.                 }
  409.                 location @fallback {
  410.                         proxy_pass http://91.202.44.222:81;
  411.                         proxy_set_header Host $host;
  412.                         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  413.                         proxy_set_header X-Forwarded-Proto $scheme;
  414.                         proxy_set_header X-Real-IP $remote_addr;
  415.                 }
  416.                 location ^~ /webstat/ {
  417.                         auth_basic "Restricted area";
  418.                         auth_basic_user_file /var/www/isengard/data/etc/206569542.passwd;
  419.                         try_files $uri @fallback;
  420.                 }
  421.                 limit_conn isengard 65535;
  422.                 include /usr/local/ispmgr/etc/nginx.inc;
  423.                 ssl_certificate /var/www/httpd-cert/isengard/db.ezwow.org.chained.crt;
  424.                 ssl_certificate_key /var/www/httpd-cert/isengard/db.ezwow.org.key;
  425.         }
  426. }
  427.  
  428. root@ezemail:/backup/etc/nginx#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement