Created
September 16, 2025 18:36
-
-
Save mike-moreau/35f7c04cfb6eca5c4ef9a0cf72056c28 to your computer and use it in GitHub Desktop.
Block access to admin.php by IP address in NGINX (Laravel Forge)
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
# FORGE CONFIG (DO NOT REMOVE!) | |
include forge-conf/www.example.com/before/*; | |
server { | |
location /admin { | |
allow 123.456.789.001; # your ip here | |
deny all; | |
try_files $uri $uri/ /index.php?$query_string; | |
} | |
location / { | |
try_files $uri $uri/ /index.php?$query_string; | |
} | |
} | |
# FORGE CONFIG (DO NOT REMOVE!) | |
include forge-conf/www.example.com/after/*; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment