

server {
######################################################################
## Server configuration
######################################################################
listen *:443 ssl http2;
server_name 3dpaneli.ru www.3dpaneli.ru ;
root /var/www/3dpaneli.ru/web;
######################################################################
## Enable gzip for proxied requests and static files
######################################################################
# Enable gzip for proxied requests and static files
gzip on;
gzip_proxied any;
gzip_vary on;
gzip_http_version 1.1;
gzip_types application/javascript application/json text/css text/xml;
gzip_comp_level 4;
######################################################################
## SSL configuration
######################################################################
# recommended but not manditory directive
# leave commented out unless you know what it is doing
#more_set_headers 'Strict-Transport-Security: max-age=15768000';
ssl on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 1h;
ssl_protocols TLSv1.2 TLSv1.3;
add_header Strict-Transport-Security "max-age=15768000" always;
ssl_stapling on;
ssl_stapling_verify on;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_certificate /var/www/clients/client132/web171/ssl/3dpaneli.ru-le.crt;
ssl_certificate_key /var/www/clients/client132/web171/ssl/3dpaneli.ru-le.key;
ssl_dhparam /etc/nginx/ssl/dhparam.pem;
######################################################################
## Log configuration
######################################################################
#Все логи отключены
error_log /dev/null crit;
access_log off;
######################################################################
## Errors send to apache2
######################################################################
# у апача своих алиасов куча, а так же некоторая статика отдается
# средствамси php, по этому все ошибки обрабатывать только apache2
error_page 401 403 404 405 500 502 503 = @fallback;
location @fallback {
proxy_pass https://127.0.0.1:4443;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header HTTPS YES;
}
######################################################################
## Locations configuration
######################################################################
#Отключаем логирование ошибок No such file or directory
## Disable .htaccess files
location ~ /\.ht {
deny all;
access_log off;
log_not_found off;
}
##
location = /favicon.ico {
log_not_found off;
access_log off;
}
##
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
##
######################################################################
# сервисы на сайте phpmyadmin почта и letxencrypt
location /phpmyadmin/ {
deny all;
root /usr/share/phpmyadmin/;
}
##
location /webmail/ {
rewrite ^/(.*)$ https://$http_host:8080/$1 permanent;
}
# letsencrypt
location /.well-known/acme-challenge/ {
alias /usr/local/ispconfig/interface/acme/;
default_type text/plain;
}
# static content
# Отдаем статику напрямую с nginx
location ~* ^.+\.(jpg|jpeg|svg|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/3dpaneli.ru/web;
access_log off;
expires max;
gzip_static on;
}
# default location
location / {
index index.php index.html index.htm;
proxy_pass https://127.0.0.1:4443;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header HTTPS YES;
}
}server {
listen *:80;
server_name 3dpaneli.ru www.3dpaneli.ru ;
root /var/www/3dpaneli.ru/web;
......
proxy_pass http://127.0.0.1:82;
....
}
man ls | grep -A 1 "\-\-color\[=WHEN\]"
-A 1 - after 1 строка после найденого'\-\-color\[\=WHEN\]' - экранируем спец символыman ls | grep -A 1 "\-\-color\[=WHEN\]" | tail -n1tail - n1 показать 1 строчку с концаman ls | grep -A 1 "\-\-color\[=WHEN\]" | grep -v =WHEN
RewriteEngine On
RewriteBase /
RewriteRule ^robots.txt$ /robots.php [L]
server {
listen *:80;
server_name 3dpaneli.ru www.3dpaneli.ru ;
root /var/www/3dpaneli.ru/web;
....
location / {
proxy_pass https://127.0.0.1:443;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
......
}
RewriteEngine on
# Директива включает редиректы.
ErrorDocument 404 /404.html
# 404 ведет на 404.html
############################################################################
#### Выбор основного зеркала (с www или без www) ####
############################################################################
# 1. Удалить www
RewriteCond %{ENV:HTTPS} on
#Если включен https
RewriteRule .* - [E=SSL:s]
#То создаем переменную ssl с текстом s
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
# Проверяем, содержит ли домен www в начале URL.
RewriteRule ^(.*)$ http%{ENV:SSL}://%1/$1 [R=301,L]
# Перенаправляем удаляем www
############################################################################
#### Перенаправляем протокол http на https ####
############################################################################
RewriteCond %{HTTPS} off
# Проверяем наличие https в URL.
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Перенаправляем протокол на http.
############################################################################
#### Убираем index.php, если он есть в конце URL ####
############################################################################
RewriteCond %{REQUEST_URI} ^(.*)/index\.php$
# URL cодержит index.php в конце.
RewriteCond %{REQUEST_METHOD} =GET
# Выявляем GET запрос в URL (не POST).
RewriteRule ^(.*)$ %1/ [R=301,L]
# Удалить index.php из URL.
############################################################################
#### Убираем повторяющиеся слеши (/) в URL ####
############################################################################
RewriteCond %{THE_REQUEST} //
# Проверяем, повторяется ли слеш (//) более двух раз.
RewriteCond %{QUERY_STRING} !http(s|)://
# Убедимся что это не урл в GET
RewriteRule .* /$0 [R=301,L]
# Исключаем все лишние слеши.
############################################################################
#### Убираем слеши в конце URL для статических файлов (содержит точку) ####
############################################################################
RewriteCond %{REQUEST_URI} \..+$
# Если файл содержит точку.
RewriteCond %{REQUEST_FILENAME} !-d
# И это не директория.
RewriteCond %{REQUEST_FILENAME} -f
# Является файлом.
RewriteCond %{REQUEST_URI} ^(.+)/$
# И в конце URL есть слеш.
RewriteRule ^(.+)/$ /$1 [R=301,L]
# Исключить слеш.
############################################################################
#### Добавляем слеш(/), если его нет, и это не файл. ####
############################################################################
RewriteCond %{REQUEST_URI} !(.*)/$
# Если слеша в конце нет.
RewriteCond %{REQUEST_FILENAME} !-f
# Не является файлом.
RewriteCond %{REQUEST_URI} !\..+$
# В URL нет точки (файл).
RewriteCond %{REQUEST_URI} ^(.+)$
# В URL есть хоть один символы
RewriteRule ^(.*)$ $1/ [L,R=301]
# Добавляем слеш в конце.
############################################################################
#### если это заглавные буквы от трех до девяти например ВАСЯ.html ####
############################################################################
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.html\ HTTP
# если это английские заглавные буквы от 3 до 9
RewriteRule ^([^.]+)\.html$ https://auto-cartel.ru/$1 [R=301,L]
# то удалить html останется просто /ВАСЯ, на другие случаи не распространяется.
############################################################################
#### ЧПУ ДВИЖКА стоит всегда в самом низу правил ####
############################################################################
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.html
############################################################################
#### Компрессия статического контента для гугл спид тест ####
############################################################################
<IfModule mod_deflate.c>
AddType image/svg+xml .svg
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE image/svg+xml
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/svg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
ExpiresByType application/x-font-ttf "access plus 1 year"
ExpiresByType application/x-font-opentype "access plus 1 year"
ExpiresByType application/x-font-woff "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
</IfModule>
<IfModule mod_headers.c>
<filesmatch "\.(ico|flv|jpg|jpeg|webp|png|gif|css|swf|woff|pdf)$">
Header set Cache-Control "max-age=31536000, public"
</filesmatch>
<filesmatch "\.(html|htm)$">
Header set Cache-Control "max-age=7200, private, must-revalidate"
</filesmatch>
<filesmatch "\.(pdf)$">
Header set Cache-Control "max-age=86400, public"
</filesmatch>
<filesmatch "\.(js|otf|ttf|woff|woff2)$">
Header set Cache-Control "max-age=31536000, private"
</filesmatch>
</IfModule>
############################################################################
#### Конец общей части, далее следует собственные директивы .htaccess ####
############################################################################
location / {
index index.php index.html index.htm;
proxy_pass https://127.0.0.1:4443;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header HTTPS YES;
}proxy_pass http://127.0.0.1:9443;
proxy_set_header Host $host:9443;
cat /var/log/nginx/access.log | grep "тут признак того что хиты нужные тебе пошли на него" | grep " тут признак по дате или через awk там омжно диапазон дат указывать." && /usr/bin/php /home/www/xxxx/current/app/cli.php cache clear prod
?:удаляет эту группу из выбора по этому у тебя будет первая
find . -type f -regextype posix-egrep -regex ".*/(.{3,5})\.([^\.]+)$"-exec но можно и пережитьfind . -type f | grep -P "/(.{3,5})\.([^\.]+)$"
cat you.log | grep "условие по дате" | grep "ваше условие че вы там ищете" | grep " тут еще условие" > 111.txt|tail -f | grep поскольку вы в отличие от открывания лога тут смотрите в режиме риалтамйм, очень удобно для работы.
find /tmp/you_papka -type d -exec chmod 755 {} ;\ - выставить права на все каталогиfind /tmp/you_papka -type f -exec chmod 644 {} ;\ - выставить права на все файлы в этой папке и нижеchmod -R root:root /tmp/you_papka- владелец root группа root на все что в этой папке (опасная команда вводить только с полным путем иначе есть вариант снести права всей системы ооочень быстро работает.
RewriteCond %{QUERY_STRING} (?:^|&)id\=(.+)(?:$|&)
RewriteRule ^cat/название/dir/1\.php$ /cat/название? [L,R=301]