Last active
December 18, 2019 00:25
-
-
Save scottjbarr/7261c661f35322f772b7 to your computer and use it in GitHub Desktop.
Nginx - redirects php, asp, cgi (etc) to Recursive David Hasselhoff
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
server { | |
listen *:80; | |
root /u/apps/...; | |
passenger_enabled on; | |
passenger_ruby /usr/local/rvm/gems/ruby-2.2.0/wrappers/ruby; | |
rails_env staging; | |
client_max_body_size 20M; | |
# Give hackers that are probing for php, asp, cgi (etc) something to laugh | |
# about with a bit of recursive David Hasselhoff :) | |
location ~ \.(php.?|asp.?|cgi.?)$ { | |
rewrite ^/(.*) https://i.imgur.com/Cu288Sy.gif permanent; | |
} | |
location ~ ^/manager/status { | |
rewrite ^/(.*) https://i.imgur.com/Cu288Sy.gif permanent; | |
} | |
location ~* (translators|phpmyadmin) { | |
rewrite ^/(.*) https://i.imgur.com/Cu288Sy.gif permanent; | |
} | |
# | |
# End of funny redirects | |
# | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment