#user nobody;
worker_processes 4;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
limit_conn_zone $binary_remote_addr zone=addr:10m;
limit_conn addr 3;
include 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"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#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;
# }
#}
include /home/r1/data/www/rt.ru/nginx/*;
# 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 16M;
log_format isp '$bytes_sent $request_length';
}
server {
server_name rt.ru superrt.ru www.rt.ru;
listen 89.108.75.196;
# listen 89.108.75.196:443 ssl;
charset CP1251;
disable_symlinks if_not_owner from=$root_path/$subdomain;
index index.php index.shtml;
set $root_path /home/r1/data/www/rt.ru;
set $subdomain "";
if ($host ~* ^((.*).rt.ru)$) {
set $subdomain $2;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
root $root_path/$subdomain;
# access_log /home/nginx-logs/r1 isp;
access_log /home/httpd-logs/rt.ru.access.log ;
error_page 404 = @fallback;
}
location / {
proxy_pass http://89.108.75.196:81;
proxy_redirect http://89.108.75.196: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://89.108.75.196:81;
proxy_redirect http://89.108.75.196: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://89.108.75.196: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/r1/new_rt.ru.chained.crt;
# ssl_certificate_key /home/httpd-cert/r1/new_rt.ru.key;
error_page 404 = http://rt.ru/404/;
}
server {
server_name rt.ru superrt.ru www.rt.ru;
# listen 89.108.75.196;
listen 89.108.75.196:443 ssl;
charset CP1251;
disable_symlinks if_not_owner from=$root_path/$subdomain;
index index.php index.shtml;
set $root_path /home/r1/data/www/rt.ru;
set $subdomain "";
if ($host ~* ^((.*).rt.ru)$) {
set $subdomain $2;
}
if ( $scheme = "http" ) {
rewrite ^/(.*)$ https://$host/$1 permanent;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
root $root_path/$subdomain;
# access_log /home/nginx-logs/r1 isp;
access_log /home/httpd-logs/rt.ru.access.log ;
error_page 404 = @fallback;
}
location / {
proxy_pass http://89.108.75.196:81;
proxy_redirect http://89.108.75.196:81/ https://rt.ru/;
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://89.108.75.196:81;
proxy_redirect http://89.108.75.196: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://89.108.75.196: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/r1/new_rt.ru.chained.crt;
ssl_certificate_key /home/httpd-cert/r1/new_rt.ru.key;
error_page 404 = http://rt.ru/404/;
}
# -FrontPage-
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
#The next line modified by DenyIP
order allow,deny
#The next line modified by DenyIP
#deny from all
allow from all
deny from 193.33.179.143
deny from 193.200.150.
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
#AuthName www.rt.ru
#AuthUserFile /var/www/rt1/data/www/rt.ru/_vti_pvt/service.pwd
#AuthGroupFile /var/www/rt1/data/www/rt.ru/_vti_pvt/service.grp
ErrorDocument 404 /404.shtml
ErrorDocument 403 /403.shtml
ErrorDocument 400 /400.shtml
ErrorDocument 500 /500.shtml
ErrorDocument 401 /401.shtml
#AddType application/x-httpd-php5 .php
#order allow deny
#deny from all
#allow from 213.170.94.74
правьте ссылки налету