Update envip.md

This commit is contained in:
Руслан 2023-10-09 01:45:51 +06:00 committed by GitHub
parent 973229c88d
commit 866c950a41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@ tags: [linux, caddy]
```sh ```sh
wh.<your.domain> { wh.<your.domain> {
@block { @block {
not remote_ip forwarded {$WHITE_LIST} not client_ip {$WHITE_LIST}
} }
handle @block { handle @block {
basicauth { basicauth {
@ -27,20 +27,20 @@ wh.<your.domain> {
header_up X-Real-IP {remote_host} header_up X-Real-IP {remote_host}
} }
} }
respond "IP already added! :)" respond "IP bleached! :)"
} }
``` ```
Пример поддомена, доступ до которого разрешён только с IP из whitelist: Пример поддомена, доступ до которого разрешён только с IP из whitelist:
```sh ```sh
sub.<your.domain> { sub.<your.domain> {
@allow { @block {
remote_ip forwarded {$WHITE_LIST} not client_ip {$WHITE_LIST}
} }
handle @allow { handle @block {
reverse_proxy localhost:50001 redir https://wh.<your.domain>
} }
respond 403 reverse_proxy localhost:50001
} }
``` ```