Created
July 19, 2020 09:18
-
-
Save miladoll/fc282004348691b74793c648c2f4fa48 to your computer and use it in GitHub Desktop.
ぼくのかんがえたかっこいいWordPress管理ページアクセス拒否.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // safe_hosts.conf | |
| geo $safe_hosts { | |
| default 0; | |
| 127.0.0.1 1; | |
| # : etc. | |
| } | |
| // is_wordpress_admin_page.conf | |
| map $uri $is_wordpress_admin_page { | |
| default 0; | |
| "~^/wp-login\.php" 1; | |
| # : etc. | |
| } | |
| // host_www.hogehoge.com.conf | |
| set $NONESAFE_ADMINACCESS ""; | |
| if ( $safe_hosts = 0 ) { | |
| set $NONESAFE_ADMINACCESS "NONESAFE"; | |
| } | |
| if ( $is_wordpress_admin_page = 1 ) { | |
| set $NONESAFE_ADMINACCESS "${NONESAFE_ADMINACCESS}_ADMINACCESS"; | |
| } | |
| if ( $NONESAFE_ADMINACCESS = "NONESAFE_ADMINACCESS" ) { | |
| return 403; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment