proxy_pass http://phpmyadmin:80;
#proxy
include nginxconfig.io/proxy.conf;
http://service.com/api/lol?token=123&a=1&b=2
<img src="/path?a=1&b=2"
, а в location перед проксированием к GET параметрам a=1&b=2 будет добавлен token=123.location = /path {
rewrite ^ /api/lol?token=123 break;
proxy_pass http://service.com;
}
# Файл по умолчанию
DirectoryIndex index.php
# Директива
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
# Кодировка
AddDefaultCharset UTF-8
Options -Indexes +FollowSymLinks -MultiViews
# Редиректы
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?%{QUERY_STRING}&module=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [L]
By default all Require directives are handled as though contained within a <RequireAny>
container directive. In other words, if any of the specified authorization methods succeed, then authorization is granted.
<RequireAny>
. Так что достаточно совпадения одного из условий.<RequireAll>
Require valid-user
Require ip 192.168.10.20
</RequireAll>
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\ HTTP/
RewriteRule .* - [L,R=404]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^index$ - [L,R=404]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^index$|\.php - [L,R=404]