From 4d11bcca856563c1a6b34e4a4f9895f98b706d45 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20H=C3=B6xter?= Date: Thu, 7 Mar 2019 16:51:37 +0100 Subject: [PATCH] add nginx script to reply with arbitrary return codes --- nginx/set_status_code.conf | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 nginx/set_status_code.conf 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 -- 2.39.5