Skip to content

Instantly share code, notes, and snippets.

@tonyarkles
Created September 3, 2016 21:38
Show Gist options
  • Save tonyarkles/853c906b8eff40f8dd1b9bcbcf30f0ca to your computer and use it in GitHub Desktop.
Save tonyarkles/853c906b8eff40f8dd1b9bcbcf30f0ca to your computer and use it in GitHub Desktop.
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
error_page 404 = @boom; # Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
location /blammo {
add_header Content-Type text/plain;
return 200 "Hi there";
}
location @boom {
#set_escape_uri $orig_uri $scheme://$http_host$request_uri$is_arg$args;
set $orig_uri $scheme://$http_host$request_uri; #$is_args$args;
return 302 $scheme://$http_host/blammo?return_to=$orig_uri;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment