Skip to content

Instantly share code, notes, and snippets.

@scottjbarr
Last active December 18, 2019 00:25
Show Gist options
  • Save scottjbarr/7261c661f35322f772b7 to your computer and use it in GitHub Desktop.
Save scottjbarr/7261c661f35322f772b7 to your computer and use it in GitHub Desktop.
Nginx - redirects php, asp, cgi (etc) to Recursive David Hasselhoff
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