Created
August 24, 2018 00:39
-
-
Save alectrocute/bf141966f82356519b98ed0296a8877f to your computer and use it in GitHub Desktop.
This file contains 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
Example index.php file: | |
<?php | |
//if ($_SERVER['REMOTE_HOST'] != "_") { | |
//echo $_SERVER['SERVER_NAME'] . " blocked."; | |
// } else { | |
//echo "hi."; | |
//} | |
echo $_SERVER['HTTP_HOST']; | |
?> | |
Example nginx config: | |
(empty.gif is a tiny 1x1px image) | |
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
root /var/www/html; | |
index index.html index.htm index.php; | |
autoindex off; | |
server_name _; | |
error_page 404 /empty.gif; | |
error_page 415 /empty.gif; | |
error_page 410 /empty.gif; | |
location / { | |
expires max; | |
try_files $uri $uri/ =404; | |
} | |
location ~ \.php$ { | |
include snippets/fastcgi-php.conf; | |
# | |
# # With php-fpm (or other unix sockets): | |
fastcgi_pass unix:/run/php/php7.2-fpm.sock; | |
# # With php-cgi (or other tcp sockets): | |
# fastcgi_pass 127.0.0.1:9000; | |
} | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment