addDefaultCharset utf8;
RewriteEngine on
RewriteCond $1 !^(index\.php|app|landing|robots\.txt|favicon\.png|files|politic.html|httploaders.txt|site|SQLyogTunnel\.php)
RewriteCond {REQUEST_URI} !^.*papkaland/&
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{HTTP_HOST} aaa\.com [NC]
#если этот домен, кстати не учтено что может быть и с ввв (www\.|)
RewriteCond %{REQUEST_FILENAME} -f
# и если это файл ? надеюсь это физические файлы, если нет то отключить этот пункт
RewriteCond %{REQUEST_URI} (.+)\.(jpg|jpeg|png|svg|tif|gif))& [NC]
# а так же 1 и более символов после него точка и расширение (список), конец строки
RewriteRule (.*) bbb.com/%1 [L,R=301]
#То %1 это первая скобка из Rewritecond не путай с $1 это первая скобка рула.
server {
listen 80 default;
server_name _;
server_name_in_redirect off;
resolver 127.0.0.1;
error_page 404 = @fallback;
#--------------Все 404 отдаем на обработку апача-------------------------------
location @fallback {
proxy_pass http://$host:82;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
#--------------Статический контент отдаем на прямую-----------------------------
location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|flv|mp3)$ {
root /var/www/$host/web;
access_log off;
expires 30d;
}
#--------------HTML Вывел отдельно посколку файлы могут быть динамические-------
location ~* ^.+\.(htm|html)$ {
root /var/www/$host/web;
access_log off;
expires 30d;
}
# -------------Основнйо локейшен -----------------------------------------------
location / {
root /var/www/$host/web;
index index.php index.html index.htm;
access_log off;
proxy_pass http://$host:82;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
#-------------- Настройки для phpmyadmin----------------------------------------
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
proxy_pass http://$host:82;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}
#------------- WEBMAIL----------------------------------------------------------
location /webmail {
root /var/www/apps;
index index.php index.html index.htm;
proxy_pass http://$host:82;
proxy_set_header X-Real-IP $remote_addr;
location ^~ /awstats-icon {
alias /usr/share/awstats/icon/;
access_log off;
}
location ^~ /awstatscss {
alias /usr/share/doc/awstats/examples/css/;
access_log off;
}
location ^~ /awstatsclasses {
alias /usr/share/doc/awstats/examples/classes/;
access_log off;
}
} # Закрывает весь server !!!
server {
#------- Server configuration---------------------------------------------------
listen 80;
server_name infoodessa.com www.infoodessa.com 176.31.8.150;
root /var/www/infoodessa.com/web;
#-------- Error page ----------------------------------------------------------
error_page 404 = @fallback;
location @fallback {
proxy_pass http://infoodessa.com:82;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
#-------DEV--------------------------------------------------------------------
error_page 555 = @pass;
location @pass {
auth_basic "Unauthorized";
auth_basic_user_file /var/www/dev_htpasswd;
proxy_pass http://infoodessa.com:82;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
# ------ Log configuration ----------------------------------------------------
access_log off;
#error_log /var/log/ispconfig/httpd/infoodessa.com/nginx_error.log error;
#access_log /var/log/ispconfig/httpd/infoodessa.com/nginx_access.log combined;
#------ static content --------------------------------------------------------
location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|flv|mp3)$ {
root /var/www/infoodessa.com/web;
access_log off;
expires 30d;
}
#------ Locations configuration -----------------------------------------------
# global locations
# alias to local error docsinfoodessa.com www.infoodessa.com
location ^~ /error { root /var/www; }
# default location
location / {
index index.php index.html index.htm;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://infoodessa.com:82;
proxy_set_header Host $host;
if ($http_host ~* "^(dev|old|www.dev)\..*\..{2,8}$"){
return 555;
}
if ($http_host ~* "^.*\.ks03\.ru$"){
return 555;
}
}
#------- Directives configuration ---------------------------------------------
# для битрикс монитора
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options SAMEORIGIN;
include /etc/nginx/locations.d/*.conf;
<Directory /var/www/infoodessa.com>
AllowOverride None
Order Deny,Allow
Deny from all
</Directory>
<VirtualHost *:82>
DocumentRoot /var/www/infoodessa.com/web
ServerName infoodessa.com
ServerAlias www.infoodessa.com
ServerAlias www.109.74.130.76 109.74.130.76
ServerAlias www.176.31.8.150 176.31.8.150
ServerAdmin admin@rackster-server.ch
ErrorLog /var/log/ispconfig/httpd/infoodessa.com/error.log
Alias /error/ /var/www/error/
<Directory /var/www/error/>
Options +FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ErrorDocument 400 /error/400.html
ErrorDocument 401 /error/401.html
ErrorDocument 403 /error/403.html
ErrorDocument 404 /error/404.html
ErrorDocument 405 /error/405.html
ErrorDocument 500 /error/500.html
ErrorDocument 502 /error/502.html
ErrorDocument 503 /error/503.html
<Directory /var/www/infoodessa.com/web>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/clients/client2/web3/web>
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<IfModule mod_suexec.c>
SuexecUserGroup web3 client2
</IfModule>
# Clear PHP settings of this website
<FilesMatch ".+\.ph(p[345]?|t|tml)$">
SetHandler None
</FilesMatch>
# php as fast-cgi enabled
# For config options see: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
<IfModule mod_fcgid.c>
FcgidIdleTimeout 300
FcgidProcessLifeTime 3600
# FcgidMaxProcesses 1000
FcgidMinProcessesPerClass 0
FcgidMaxProcessesPerClass 10
FcgidConnectTimeout 3
FcgidIOTimeout 1600
FcgidBusyTimeout 3600
FcgidMaxRequestLen 1073741824
</IfModule>
<Directory /var/www/infoodessa.com/web>
<FilesMatch "\.php[345]?$">
SetHandler fcgid-script
</FilesMatch>
FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php
FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php3
FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php4
FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php5
Options +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/clients/client2/web3/web>
<FilesMatch "\.php[345]?$">
SetHandler fcgid-script
</FilesMatch>
FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php
FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php3
FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php4
FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php5
Options +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# add support for apache mpm_itk
<IfModule mpm_itk_module>
AssignUserId web3 client2
</IfModule>
</VirtualHost>
<IfModule dir_module>
DirectoryIndex index.php index.html index.htm
</IfModule>
RewriteCond %{REQUEST_METHOD} =GET
RewriteCond %{REQUEST_URI} ^(.*)/index\.php$
RewriteRule ^(.*)$ %1/ [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)первый_гет($|&)
RewriteCond %{QUERY_STRING} (^|&)еще_гет($|&)
RewriteCond %{QUERY_STRING} (^|&)и так_далее($|&)
############################################################################
#### Cтандартный .htaccess для проектов студии Клондайк, версия 2.3 ####
############################################################################
RewriteEngine On
# Директива включает редиректы.
RewriteBase /
# Без директивы (.*) = /$1 будет /var/wwww/site/web/$1 с директивой = /$1
Options +FollowSymLinks
# Разрешает переход по символическим ссылкам.
############################################################################
#### Перенаправляем протокол https на http ####
############################################################################
#RewriteCond %{HTTPS} On
# Проверяем наличие https в URL.
#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Перенаправляем протокол на https.
############################################################################
#### Выбор основного зеркала (или с www или без www) ####
############################################################################
# 1. Редирект с www на без www. (раскоментировать директивы пункта 1)
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
# Проверяем, содержит ли домен www (в начале URL).
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
# Перенаправляем URL на домен без www.
####
# 2. Редирект без www на www. (раскоментировать директивы пункта 2)
#RewriteCond %{HTTP_HOST} !^www\.(.*) [NC]
# Проверяем, не содержит ли домен www (в начале URL).
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# Перенаправляем URL на домен c www.
############################################################################
#### Убираем повторяющиеся слеши (/) в URL ####
############################################################################
RewriteCond %{THE_REQUEST} //
RewriteRule .* /$0 [R=301,L]
############################################################################
#### Убираем слеши в конце URL для статических файлов (содержит точку) ####
############################################################################
RewriteCond %{REQUEST_URI} !(.*)/$
# Если слеша в конце нет.
RewriteCond %{REQUEST_FILENAME} !-f
# Не является файлом.
RewriteCond %{REQUEST_URI} !\..+$
# В URL нет точки (файл).
RewriteRule ^(.*)$ $1/ [L,R=301]
# Добавляем слеш в конце.
############################################################################
#### Добавляем слеш(/), если его нет, и это не файл. ####
############################################################################
RewriteCond %{REQUEST_URI} !(.*)/$
# Если слеша в конце нет.
RewriteCond %{REQUEST_FILENAME} !-f
# Не является файлом.
RewriteCond %{REQUEST_URI} !\..+$
# В URL нет точки (файл).
RewriteRule ^(.*)$ $1/ [L,R=301]
# Добавляем слеш в конце.
############################################################################
#### Убираем index.php, если он есть в конце URL ####
############################################################################
RewriteCond %{REQUEST_METHOD} =GET
# Выявляем GET запрос в URL (не POST).
RewriteCond %{REQUEST_URI} ^(.*)/index\.php$
# URL cодержит index.php в конце.
RewriteRule ^(.*)$ %1/ [R=301,L]
# Удалить index.php из URL.
############################################################################
#### Компрессия статического контента для гугл спид тест ####
############################################################################
RewriteCond %{REQUEST_URI} ^([A-z0-9-]+)$/(posts|pages)/([A-z0-9-]+)/$1 [NC]
RewriteRule .* http://site.ru/%1%3
# 301 --- http://site.ru/index.php?route=product/product&path=57&product_id=61 => http://site.ru/zhylety/zhiletprofi16
RewriteCond %{QUERY_STRING} (^|&)route\=product/product($|&)
RewriteCond %{QUERY_STRING} (^|&)path\=57($|&)
RewriteCond %{QUERY_STRING} (^|&)product_id\=61($|&)
RewriteRule ^index\.php$ /zhylety/zhiletprofi16? [L,R=301]
<VirtualHost 127.0.0.1:80>
ServerName test.ru
ServerAlias www.test.ru
ServerAdmin test@bk.ru
DocumentRoot /var/www/test.ru/httpd
ErrorLog logs/test_ru_error_log
LogLevel warn
CustomLog logs/test_ru_assest_log combined
<Directory /var/www/test.ru/httpd>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
DirectoryIndex index.php index.html index.htm
Order allow,deny
allow from all
</Directory>
</VirtualHost>
<VirtualHost 127.0.0.1:80>
ServerName forum.test.ru
ServerAlias www.forum.test.ru
ServerAdmin test@bk.ru
DocumentRoot /var/www/forum.test.ru/httpd
ErrorLog logs/forum_test_ru_error_log
LogLevel warn
CustomLog logs/forum_test_ru_assest_log combined
<Directory /var/www/forum.test.ru/httpd>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
DirectoryIndex index.php index.html index.htm
Order allow,deny
allow from all
</Directory>
</VirtualHost>
<VirtualHost 127.0.0.1:80>
ServerName media.test.ru
ServerAlias www.media.test.ru
ServerAdmin test@bk.ru
DocumentRoot /var/www/media.test.ru/httpd
ErrorLog logs/media_test_ru_error_log
LogLevel warn
CustomLog logs/media_test_ru_assest_log combined
<Directory /var/www/media.test.ru/httpd>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
DirectoryIndex index.php index.html index.htm
Order allow,deny
allow from all
</Directory>
</VirtualHost>
iotop -oka