From: Sven Höxter Date: Thu, 7 Mar 2019 15:51:37 +0000 (+0100) Subject: add nginx script to reply with arbitrary return codes X-Git-Url: http://git.sven.stormbind.net/?p=sven%2Fscripts.git;a=commitdiff_plain;h=4d11bcca856563c1a6b34e4a4f9895f98b706d45;ds=sidebyside add nginx script to reply with arbitrary return codes --- diff --git a/nginx/set_status_code.conf b/nginx/set_status_code.conf new file mode 100644 index 0000000..4dadbab --- /dev/null +++ b/nginx/set_status_code.conf @@ -0,0 +1,8 @@ +location ~ ^/sc/([0-9]+) { + default_type 'text/plain'; + set $sc $1; + content_by_lua_block { + ngx.status=ngx.var.sc + ngx.say("Status code requested: ", ngx.var.sc) + } +} \ No newline at end of file