mirror of
https://github.com/fruworg/envip.git
synced 2025-01-18 09:10:51 +03:00
Update README.md
This commit is contained in:
parent
e1d03e8d66
commit
921a8ff1a7
19
README.md
19
README.md
@ -7,10 +7,10 @@
|
||||
### Caddy
|
||||
|
||||
В Caddyfile необходимо добавить секцию с поддоменом для обновления whitelist (необходимо заменить [строку basic auth](https://caddyserver.com/docs/caddyfile/directives/basicauth)):
|
||||
```sh
|
||||
```
|
||||
wh.<your.domain> {
|
||||
@block {
|
||||
not remote_ip forwarded {$WHITE_LIST}
|
||||
not client_ip {$WHITE_LIST}
|
||||
}
|
||||
handle @block {
|
||||
basicauth {
|
||||
@ -20,22 +20,23 @@ wh.<your.domain> {
|
||||
header_up X-Real-IP {remote_host}
|
||||
}
|
||||
}
|
||||
respond "IP already added! :)"
|
||||
respond "IP bleached! :)"
|
||||
}
|
||||
```
|
||||
|
||||
Пример поддомена, доступ до которого разрешён только с IP из whitelist:
|
||||
```sh
|
||||
```
|
||||
sub.<your.domain> {
|
||||
@allow {
|
||||
remote_ip forwarded {$WHITE_LIST}
|
||||
@block {
|
||||
not client_ip {$WHITE_LIST}
|
||||
}
|
||||
handle @block {
|
||||
redir https://wh.<your.domain>
|
||||
}
|
||||
handle @allow {
|
||||
reverse_proxy localhost:50001
|
||||
}
|
||||
respond 403
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
В `caddy.service` необходимо добавить следующую строку в секцию `[Service]`:
|
||||
```sh
|
||||
|
Loading…
x
Reference in New Issue
Block a user