Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root@ezemail:/backup/etc/nginx# cat nginx.conf
- user apache;
- worker_processes auto;
- worker_rlimit_nofile 200000;
- worker_priority -10;
- error_log /var/log/nginx/error.log;
- #error_log /var/log/nginx/error.log notice;
- #error_log /var/log/nginx/error.log info;
- pid /var/run/nginx.pid;
- events {
- worker_connections 8192;
- multi_accept on;
- use epoll;
- }
- http {
- include /etc/nginx/mime.types;
- default_type application/octet-stream;
- log_format main '$remote_addr - $remote_user [$time_local] "$request" '
- '$status $body_bytes_sent "$http_referer" '
- '"$http_user_agent" "$http_x_forwarded_for"';
- log_format timed_combined '$remote_addr - $remote_user [$time_local] '
- '"$request" $status $body_bytes_sent '
- '"$http_referer" "$http_user_agent" '
- '$request_time $upstream_response_time $pipe';
- map $http_upgrade $connection_upgrade {
- default upgrade;
- '' close;
- }
- access_log /var/log/nginx/access.log timed_combined;
- geoip_city /usr/share/GeoIP/GeoIPCity.dat;
- geoip_country /usr/share/GeoIP/GeoIP.dat;
- # map $geoip_country_code $good_country {
- # default no;
- # RU yes;
- # UA yes;
- # BY yes;
- # KZ yes;
- # MD yes;
- # LT yes;
- # LV yes;
- # UZ yes;
- # KG yes;
- # PL yes;
- # EE yes;
- # IL yes;
- # GE yes;
- # AM yes;
- # }
- map $geoip_city_continent_code $good_country {
- default no;
- AS yes;
- EU yes;
- }
- open_file_cache max=1000 inactive=20s;
- open_file_cache_valid 30s;
- open_file_cache_min_uses 5;
- open_file_cache_errors off;
- sendfile on;
- tcp_nopush on;
- tcp_nodelay on;
- server_tokens off;
- gzip on;
- gzip_static on;
- gzip_comp_level 9;
- gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
- #gzip_types text/plain;
- gzip_min_length 10240;
- keepalive_timeout 60;
- #keepalive_timeout 600;
- keepalive_requests 100000;
- reset_timedout_connection on;
- client_body_timeout 10;
- send_timeout 2;
- proxy_buffering on;
- proxy_buffers 32 512k;
- proxy_buffer_size 512k;
- proxy_intercept_errors on;
- proxy_connect_timeout 120;
- proxy_read_timeout 120;
- proxy_send_timeout 120;
- limit_conn_zone $binary_remote_addr zone=addr:10m;
- # Load config files from the /etc/nginx/conf.d directory
- include /etc/nginx/conf.d/*.conf;
- #####USERBARS ISENGARD CACHE#####
- proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:16m;
- # another virtual host using mix of IP-, name-, and port-based configuration
- #
- #server {
- # listen 8000;
- # listen somename:8080;
- # server_name somename alias another.alias;
- # location / {
- # root html;
- # index index.html index.htm;
- # }
- #}
- #####STUB#####
- #server {
- # listen *:8899;
- # server_name stub;
- #
- # location /
- # {
- # stub_status on;
- # access_log off;
- # }
- #}
- # HTTPS server
- #
- #server {
- # listen 443 ssl;
- # server_name localhost;
- # ssl_certificate cert.pem;
- # ssl_certificate_key cert.key;
- # ssl_session_cache shared:SSL:1m;
- # ssl_session_timeout 5m;
- # ssl_ciphers HIGH:!aNULL:!MD5;
- # ssl_prefer_server_ciphers on;
- # location / {
- # root html;
- # index index.html index.htm;
- # }
- #}
- include /usr/local/ispmgr/etc/nginx.domain;
- client_max_body_size 64M;
- log_format isp '$bytes_sent $request_length';
- limit_req_zone $binary_remote_addr zone=isengard-limit:32m rate=40r/s;
- limit_conn_zone $binary_remote_addr zone=isengard:10m;
- server {
- server_name ezwow.org www.ezwow.org;
- listen 91.202.44.222;
- listen 91.202.44.222:443 ssl;
- disable_symlinks if_not_owner from=$root_path;
- set_real_ip_from 185.121.240.32/27;
- set_real_ip_from 185.121.241.16/29;
- #real_ip_header X-Forwarded-For;
- real_ip_header X-Real-IP;
- set $root_path /var/www/isengard/data/www/ezwow.org;
- add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
- 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)$ {
- root $root_path;
- expires 7d;
- access_log /var/www/nginx-logs/isengard isp;
- access_log /var/www/httpd-logs/ezwow.org.access.log ;
- #access_log off;
- error_page 404 = @fallback;
- }
- location / {
- proxy_pass http://91.202.44.222:81;
- proxy_redirect http://91.202.44.222:81/ /;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Real-IP $remote_addr;
- # 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") {
- # set $good_country yes;
- # }
- # if ($remote_addr ~ ^10\.2\.) {
- # set $good_country yes;
- # }
- # if ($good_country = no){
- # #rewrite ^ http://cactus-net.ru/block.html;
- # return 404;
- # }
- }
- location ~* ^/(webstat|awstats|webmail|myadmin|pgadmin)/ {
- proxy_pass http://91.202.44.222:81;
- proxy_redirect http://91.202.44.222:81/ /;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Real-IP $remote_addr;
- }
- location @fallback {
- proxy_pass http://91.202.44.222:81;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Real-IP $remote_addr;
- }
- location ^~ /webstat/ {
- auth_basic "Restricted area";
- auth_basic_user_file /var/www/isengard/data/etc/208798204.passwd;
- try_files $uri @fallback;
- }
- ################КЭШ ЮЗЕРБАРОВ#################
- location ^~ /userbars {
- proxy_pass http://91.202.44.222:81;
- proxy_cache one;
- proxy_cache_valid 200 24h;
- proxy_connect_timeout 60s;
- proxy_cache_use_stale error updating timeout invalid_header http_500 http_502 http_503 http_504;
- proxy_cache_min_uses 1;
- proxy_ignore_client_abort off;
- proxy_hide_header "Set-Cookie";
- proxy_ignore_headers "Cache-Control" "Expires" "Set-Cookie";
- proxy_read_timeout 120;
- proxy_set_header Host $host;
- expires 2h;
- #try_files $uri @userbars;
- #rewrite "^(/userbars)/([a-f0-9]{32})\.png$" $1/userbar.php?hash=$2 last;
- }
- location = /robots.txt
- {
- root $root_path;
- access_log off;
- expires 1m;
- error_page 404 = @fallback;
- }
- location = /lstat.txt
- {
- root $root_path;
- access_log off;
- expires 1m;
- error_page 404 = @fallback;
- }
- location = /stat.txt
- {
- root $root_path;
- access_log off;
- expires 1m;
- error_page 404 = @fallback;
- }
- location /rss/forums/2-novosti-servera
- {
- root $root_path;
- rewrite ^ /rss/news.xml;
- }
- location /rss/forums/3-poslednie-temy
- {
- root $root_path;
- rewrite ^ /rss/last_topic.xml;
- }
- location ^~ /chat/ {
- root $root_path;
- access_log off;
- expires off;
- error_page 404 = @fallback;
- }
- location ^~ /teamspeak/ {
- proxy_pass http://91.202.44.200:3000/;
- proxy_connect_timeout 3;
- proxy_send_timeout 1d;
- proxy_read_timeout 1d;
- send_timeout 1d;
- proxy_http_version 1.1;
- proxy_redirect off;
- proxy_buffers 8 32k;
- proxy_buffer_size 64k;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Host $http_host;
- proxy_set_header X-NginX-Proxy true;
- access_log /var/www/httpd-logs/ezwow.org.teamspeak.access.log ;
- error_log /var/www/httpd-logs/ezwow.org.teamspeak.error.log ;
- }
- location ^~ /promo/ {
- proxy_pass http://91.202.44.200:3001/;
- proxy_connect_timeout 3;
- proxy_send_timeout 1d;
- proxy_read_timeout 1d;
- send_timeout 1d;
- auth_basic "closed site";
- auth_basic_user_file /var/www/isengard/data/www/ezwow.org/admin/.htpasswd;
- proxy_http_version 1.1;
- proxy_redirect off;
- proxy_buffers 8 32k;
- proxy_buffer_size 64k;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Host $http_host;
- proxy_set_header X-NginX-Proxy true;
- }
- limit_conn isengard 65535;
- include /usr/local/ispmgr/etc/nginx.inc;
- ssl_certificate /var/www/httpd-cert/isengard/ezwow.org.chained.crt;
- ssl_certificate_key /var/www/httpd-cert/isengard/ezwow.org.key;
- if ($ssl_protocol = "") {
- rewrite ^ https://$server_name$request_uri? permanent;
- }
- }
- server {
- server_name ezemail.org www.ezemail.org;
- listen 91.202.44.195;
- listen 91.202.44.195:443 ssl;
- disable_symlinks if_not_owner from=$root_path;
- set $root_path /var/www/isengard/data/www/ezemail.org;
- location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
- root $root_path;
- access_log /var/www/nginx-logs/isengard isp;
- access_log /var/www/httpd-logs/ezemail.org.access.log ;
- error_page 404 = @fallback;
- }
- location / {
- proxy_pass http://91.202.44.195:81;
- proxy_redirect http://91.202.44.195:81/ /;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Real-IP $remote_addr;
- }
- location ~* ^/(webstat|awstats|webmail|myadmin|pgadmin)/ {
- proxy_pass http://91.202.44.195:81;
- proxy_redirect http://91.202.44.195:81/ /;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Real-IP $remote_addr;
- }
- location @fallback {
- proxy_pass http://91.202.44.195:81;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Real-IP $remote_addr;
- }
- location ^~ /webstat/ {
- auth_basic "Restricted area";
- auth_basic_user_file /var/www/isengard/data/etc/209453353.passwd;
- try_files $uri @fallback;
- }
- limit_conn isengard 65535;
- include /usr/local/ispmgr/etc/nginx.inc;
- ssl_certificate /var/www/httpd-cert/isengard/ezemail.org.chained.crt;
- ssl_certificate_key /var/www/httpd-cert/isengard/ezemail.org.key;
- }
- limit_req_zone $binary_remote_addr zone=isengard-limitdb:32m rate=40r/s;
- limit_conn_zone $binary_remote_addr zone=isengarddb:10m;
- server {
- server_name db.ezwow.org;
- listen 91.202.44.222;
- listen 91.202.44.222:443 ssl;
- disable_symlinks if_not_owner from=$root_path;
- set $root_path /var/www/isengard/data/www/db.ezwow.org;
- location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
- root $root_path;
- access_log /var/www/nginx-logs/isengard isp;
- access_log /var/www/httpd-logs/db.ezwow.org.access.log ;
- error_page 404 = @fallback;
- }
- location / {
- proxy_pass http://91.202.44.222:81;
- proxy_redirect http://91.202.44.222:81/ /;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Real-IP $remote_addr;
- }
- location ~* ^/(webstat|awstats|webmail|myadmin|pgadmin)/ {
- proxy_pass http://91.202.44.222:81;
- proxy_redirect http://91.202.44.222:81/ /;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Real-IP $remote_addr;
- }
- location @fallback {
- proxy_pass http://91.202.44.222:81;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Real-IP $remote_addr;
- }
- location ^~ /webstat/ {
- auth_basic "Restricted area";
- auth_basic_user_file /var/www/isengard/data/etc/206569542.passwd;
- try_files $uri @fallback;
- }
- limit_conn isengard 65535;
- include /usr/local/ispmgr/etc/nginx.inc;
- ssl_certificate /var/www/httpd-cert/isengard/db.ezwow.org.chained.crt;
- ssl_certificate_key /var/www/httpd-cert/isengard/db.ezwow.org.key;
- }
- }
- root@ezemail:/backup/etc/nginx#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement