From 866c950a41e64053b6d2129378bd169726db7e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD?= Date: Mon, 9 Oct 2023 01:45:51 +0600 Subject: [PATCH] Update envip.md --- content/posts/envip.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/content/posts/envip.md b/content/posts/envip.md index 040a014..a96baa5 100644 --- a/content/posts/envip.md +++ b/content/posts/envip.md @@ -17,7 +17,7 @@ tags: [linux, caddy] ```sh wh. { @block { - not remote_ip forwarded {$WHITE_LIST} + not client_ip {$WHITE_LIST} } handle @block { basicauth { @@ -27,20 +27,20 @@ wh. { header_up X-Real-IP {remote_host} } } - respond "IP already added! :)" + respond "IP bleached! :)" } ``` Пример поддомена, доступ до которого разрешён только с IP из whitelist: ```sh sub. { - @allow { - remote_ip forwarded {$WHITE_LIST} + @block { + not client_ip {$WHITE_LIST} } - handle @allow { - reverse_proxy localhost:50001 + handle @block { + redir https://wh. } - respond 403 + reverse_proxy localhost:50001 } ```