controller/action/
и
controller/action/par1/value1/par2/value2
server {
listen 443 ssl;
server_name shop.wildorchid.ru www.shop.wildorchid.ru;
# enable SSL connection
#include bx/conf/ssl.conf;
ssl_certificate /etc/letsencrypt/live/shop.wildorchid.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/shop.wildorchid.ru/privkey.pem;
ssl on;
keepalive_timeout 70;
keepalive_requests 150;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA;
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/pki/nginx/dhparam.pem;
ssl_session_cache shared:SSL:10m;
ssl_protocols TLSv1.1 TLSv1.2;
add_header Strict-Transport-Security "max-age=31536000;";
#add_header Content-Security-Policy-Report-Only "default-src https:; script-src https: unsafe-eval unsafe-inline; style-src https: unsafe-inline; img-src https: data:; font-src https: data:; report-uri /csp-report";
access_log /var/log/nginx/shop_access.log main;
error_log /var/log/nginx/shop_error.log warn;
#charset utf-8;
server_name_in_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host:443;
proxy_set_header HTTPS YES;
proxy_set_header X-Forwarded-Proto https;
set $proxyserver "http://127.0.0.1:8887";
set $imcontenttype "text/html; charset=utf-8";
set $docroot "/home/bitrix/ext_www/shop.wildorchid.ru";
index index.php;
root "/home/bitrix/ext_www/shop.wildorchid.ru";
# Include parameters common to all websites
include bx/conf/bitrix.conf;
# Include munin and nagios web
include bx/server_monitor.conf;
}
<VirtualHost 127.0.0.1:8887>
ServerName shop.wildorchid.ru
ServerAlias www.shop.wildorchid.ru
ServerAdmin webmaster@localhost
DocumentRoot /home/bitrix/ext_www/shop.wildorchid.ru
ErrorLog logs/shop_error_log
LogLevel warn
CustomLog logs/shop_access_log combined
<IfModule mod_rewrite.c>
#Nginx should have "proxy_set_header HTTPS YES;" in location
RewriteEngine On
RewriteCond %{HTTP:HTTPS} =YES
RewriteRule .* - [E=HTTPS:on,L]
</IfModule>
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/bitrix/ext_www/shop.wildorchid.ru>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
DirectoryIndex index.php index.html index.htm
Order allow,deny
allow from all
php_admin_value session.save_path /tmp/php_sessions/ext_www/shop.wildorchid.ru
php_admin_value upload_tmp_dir /tmp/php_upload/ext_www/shop.wildorchid.ru
</Directory>
</VirtualHost>
<DirectoryMatch .*\.svn/.*>
Deny From All
</DirectoryMatch>
<DirectoryMatch .*\.git/.*>
Deny From All
</DirectoryMatch>
<DirectoryMatch .*\.hg/.*>
Deny From All
</DirectoryMatch>
ln --help
по сути это ярлыки на каталогиRewriteCond %{QUERY_STRING} (^|&)id\=1($|&)
RewriteRule ^search$ /search/1? [L,R=301]
?
он удалит гет парметры.RewriteCond %{QUERY_STRING} (^|&)id\=(.+)($|&)
RewriteRule ^search$ /search/%2? [L,R=301]
RewriteCond %{QUERY_STRING} (^|&)newstype\=(+*)($|&)
RewriteRule ^baza\-znanij$ /baza-znanij/%2? [L,R=301]
RewriteCond %{QUERY_STRING}
(^|&)тут гет($|&)
\=
(+*)
%2
?
cat access.log | awk {'print $1 $17 $3'}
$1
это первая колонка$17
семнадцатя колонка и так далее, уж простите вашего формата лога не видел, по этому написал на угад.| wc -l
http://www.domain.ru/works/4/?photos=3409
RewriteCond %{QUERY_STRING} (^|&)photos\=3409%2F%2F%2F%2F%2F%2F%2F%2F%2F%25($|&)
RewriteRule ^works/4/$ /works/4/\?photos=3409 [L,R=301]
(^|&)...($|&)
- просто гет запрос он может бытьне первым а вторым следовательно можен или начинаться или заканчиваться с?
или &
так что можно обойтись и без этого.photos\=
Равно экранируем[0-9]{1,}
- от нуля до 9, повторить один раз и более(..)
скобки групируют если группы из RewriteRule - ' это $1$2 и тд по номеру группы%2
- это то что будет в конде во второй скобке.