parser

Написать ответ на текущее сообщение

 

 
   команды управления поиском

nginx.conf

sineborod 12.11.2013 16:00

#user  nobody;
worker_processes  2;

error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    charset utf-8;

    gzip_static      on;
	gzip             on;
	gzip_proxied     any; #Даем понять веб-серверу, что можно жать все проксированные запросы
gzip_types       text/plain application/xml application/x-javascript text/javascript text/css text/json; #Указываем MIME типы, которые будут сжиматься
gzip_disable     «msie6″; # Отключаем сжатие для 6-го эксплорера
gzip_comp_level  6; # Указываем степень сжатия от 1 до 10, 6 — золотая середина (жрет немного процессорного времени и оптимально ужимает)

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  logs/access.log;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    log_not_found off;

    #gzip  on;



    # 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;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443;
    #    server_name  localhost;

    #    ssl                  on;
    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_timeout  5m;

    #    ssl_protocols  SSLv2 SSLv3 TLSv1;
    #    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 65M;
	log_format isp '$bytes_sent $request_length';
	server {
		server_name dom.balashov.com.ua www.dom.balashov.com.ua;
		listen 178.20.155.230;
		charset utf-8;
		disable_symlinks if_not_owner from=$root_path;
		set $root_path /home/balashovcomua/data/www/dom.balashov.com.ua;
		location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
			root $root_path;
			access_log /home/nginx-logs/balashovcomua isp;
			access_log /home/httpd-logs/dom.balashov.com.ua.access.log ;
			error_page 404 = @fallback;
		}
		location / {
			proxy_pass http://178.20.155.230:81;
			proxy_redirect http://178.20.155.230: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://178.20.155.230:81;
			proxy_redirect http://178.20.155.230: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://178.20.155.230: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;
		}
		include /usr/local/ispmgr/etc/nginx.inc;
	}
	server {
		server_name 510.balashov.com.ua www.510.balashov.com.ua;
		listen 178.20.155.230;
		charset utf8;
		disable_symlinks if_not_owner from=$root_path;
		set $root_path /home/balashovcomua/data/www/510.balashov.com.ua;
		location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
			root $root_path;
			access_log /home/nginx-logs/balashovcomua isp;
			access_log /home/httpd-logs/510.balashov.com.ua.access.log ;
			error_page 404 = @fallback;
		}
		location / {
			proxy_pass http://178.20.155.230:81;
			proxy_redirect http://178.20.155.230: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://178.20.155.230:81;
			proxy_redirect http://178.20.155.230: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://178.20.155.230: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;
		}
		include /usr/local/ispmgr/etc/nginx.inc;
	}
	server {
		server_name lipki.com.ua www.lipki.com.ua;
		listen 178.20.155.231;
		listen 178.20.155.231:443 ssl;
		charset windows-1251;
		disable_symlinks if_not_owner from=$root_path;
		set $root_path /home/lipki/data/www/lipki.com.ua;

		location /photos {
			root $root_path;
  			rewrite ^(/photos/.*)\.(jpg|png|jpeg|gif)$ /tools/thumbs.php?imgname=$1.$2;
  			      #Кеширум картинки месяца на 4
      gzip_static on;
      expires 1M;
      #Кешируем везде (и на прокси и на клиентах)
      add_header Cache-Control public;
		}



   location ~* \.(css|js|ico) {
   root   $root_path;
    # разрешаем отдавать вместо несжатого файла предварительно
    # сжатый с постфиксом ".gz", если такой есть
    gzip_static on;
    #запрещаем сжатие файлов CSS и JS для проблемных браузеров
    
    #Кешируем месяца на 2
    expires 2M;
    #Кешируем только на клиентах (ибо сжатое)
    add_header Cache-Control private;
   }

		# location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
		# 	root $root_path;
		# 	access_log /home/nginx-logs/lipki isp;
		# 	access_log /home/httpd-logs/lipki.com.ua.access.log ;
		# 	error_page 404 = @fallback;
		# }
		location / {
			root $root_path;
			proxy_pass http://178.20.155.231:81;
			proxy_redirect http://178.20.155.231: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://178.20.155.231:81;
			proxy_redirect http://178.20.155.231: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://178.20.155.231: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;
		}
		include /usr/local/ispmgr/etc/nginx.inc;
		ssl_certificate /home/httpd-cert/lipki/lipki.com.ua.crt;
		ssl_certificate_key /home/httpd-cert/lipki/lipki.com.ua.key;
	}
	server {
		server_name old.balashov.com.ua www.old.balashov.com.ua;
		listen 178.20.155.230;
		charset utf-8;
		disable_symlinks if_not_owner from=$root_path;
		set $root_path /home/balashovcomua/data/www/old.balashov.com.ua;
		location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
			root $root_path;
			access_log /home/nginx-logs/balashovcomua isp;
			access_log /home/httpd-logs/old.balashov.com.ua.access.log ;
			error_page 404 = @fallback;
		}
		location / {
			proxy_pass http://178.20.155.230:81;
			proxy_redirect http://178.20.155.230: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://178.20.155.230:81;
			proxy_redirect http://178.20.155.230: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://178.20.155.230: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;
		}
		include /usr/local/ispmgr/etc/nginx.inc;
	}
	server {
		server_name new.balashov.com.ua www.new.balashov.com.ua;
		listen 178.20.155.230;
		charset utf-8;
		disable_symlinks if_not_owner from=$root_path;
		set $root_path /home/balashovcomua/data/www/new.balashov.com.ua;
		location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
			root $root_path;
			access_log /home/nginx-logs/balashovcomua isp;
			access_log /home/httpd-logs/new.balashov.com.ua.access.log ;
			error_page 404 = @fallback;
		}
		location / {
			proxy_pass http://178.20.155.230:81;
			proxy_redirect http://178.20.155.230: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://178.20.155.230:81;
			proxy_redirect http://178.20.155.230: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://178.20.155.230: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;
		}
		include /usr/local/ispmgr/etc/nginx.inc;
	}
	server {
		server_name m.radiobalashov.com.ua www.m.radiobalashov.com.ua;
		listen 178.20.155.231;
		charset utf-8;
		disable_symlinks if_not_owner from=$root_path;
		set $root_path /home/balashov/data/www/m.radiobalashov.com.ua;
		location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
			root $root_path;
			access_log /home/nginx-logs/balashov isp;
			access_log /home/httpd-logs/m.radiobalashov.com.ua.access.log ;
			error_page 404 = @fallback;
		}
		location / {
			proxy_pass http://178.20.155.231:81;
			proxy_redirect http://178.20.155.231: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://178.20.155.231:81;
			proxy_redirect http://178.20.155.231: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://178.20.155.231: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;
		}
		include /usr/local/ispmgr/etc/nginx.inc;
	}
	server {
		server_name balashov.com.ua www.balashov.com.ua;
		listen 178.20.155.230;
		charset utf-8;
		disable_symlinks if_not_owner from=$root_path;
		set $root_path /home/balashovcomua/data/www/balashov.com.ua;



   #!Статический контент!
   location ~* \.(jpg|jpeg|gif|png|swf|tiff|swf|flv)$ {
      root   $root_path;
      #Кеширум картинки месяца на 4
      gzip_static on;
      expires 1M;
      #Кешируем везде (и на прокси и на клиентах)
      add_header Cache-Control public;
   } 


   location ~* \.(css|js|ico) {
   root   $root_path;
    # разрешаем отдавать вместо несжатого файла предварительно
    # сжатый с постфиксом ".gz", если такой есть
    gzip_static on;
    #запрещаем сжатие файлов CSS и JS для проблемных браузеров
    
    #Кешируем месяца на 2
    expires 2M;
    #Кешируем только на клиентах (ибо сжатое)
    add_header Cache-Control private;
   }



		location / {
			proxy_pass http://178.20.155.230:81;
			proxy_redirect http://178.20.155.230: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://178.20.155.230:81;
			proxy_redirect http://178.20.155.230: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://178.20.155.230: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;
		}



		include /usr/local/ispmgr/etc/nginx.inc;
	}
	server {
		server_name asfn-podcast.com www.asfn-podcast.com;
		listen 178.20.155.231;
		listen 178.20.155.231:443 ssl;
		disable_symlinks if_not_owner from=$root_path;
		set $root_path /home/asfn/data/www/asfn-podcast.com;
		location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
			root $root_path;
			access_log /home/nginx-logs/asfn isp;
			access_log /home/httpd-logs/asfn-podcast.com.access.log ;
			error_page 404 = @fallback;
		}
		location / {
			proxy_pass http://178.20.155.231:81;
			proxy_redirect http://178.20.155.231: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://178.20.155.231:81;
			proxy_redirect http://178.20.155.231: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://178.20.155.231: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;
		}
		include /usr/local/ispmgr/etc/nginx.inc;
		ssl_certificate /home/httpd-cert/asfn/asfn-podcast.com.crt;
		ssl_certificate_key /home/httpd-cert/asfn/asfn-podcast.com.key;
	}
	server {
		server_name radiobalashov.com.ua www.radiobalashov.com.ua;
		listen 178.20.155.231;
		listen 178.20.155.231:443 ssl;
		disable_symlinks if_not_owner from=$root_path;
		set $root_path /home/balashov/data/www/radiobalashov.com.ua;
		location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
			root $root_path;
			access_log /home/nginx-logs/balashov isp;
			access_log /home/httpd-logs/radiobalashov.com.ua.access.log ;
			error_page 404 = @fallback;
		}
		location / {
			proxy_pass http://178.20.155.231:81;
			proxy_redirect http://178.20.155.231: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://178.20.155.231:81;
			proxy_redirect http://178.20.155.231: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://178.20.155.231: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;
		}
		include /usr/local/ispmgr/etc/nginx.inc;
		ssl_certificate /home/httpd-cert/balashov/radiobalashov.com.ua.crt;
		ssl_certificate_key /home/httpd-cert/balashov/radiobalashov.com.ua.key;
	}
}