Created
September 2, 2018 22:44
Revisions
-
developersteve created this gist
Sep 2, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,70 @@ server { listen 443 http2 ssl; listen [::]:443 http2 ssl; server_name [domain url in here]; add_header Strict-Transport-Security "max-age=63072000; includeSubdomains"; proxy_cookie_domain ~(?P<secure_domain>([-0-9a-z]+\.)?[-0-9a-z]+\.[a-z]+)$ "$secure_domain; secure"; ssl_protocols TLSv1.2 TLSv1.1 TLSv1 TLSv1.3; ssl_prefer_server_ciphers on; ssl_ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:!aNULL:!MD5:!DSS; ssl_ecdh_curve secp384r1; ssl_session_timeout 1d; ssl_session_cache shared:SSL:10m; ssl_session_tickets off; ssl_stapling on; ssl_stapling_verify on; ssl_dhparam /etc/ssl/certs/dhparam.pem; add_header X-Frame-Options SAMEORIGIN; add_header X-Content-Type-Options nosniff; add_header X-XSS-Protection "1; mode=block"; ssl_certificate [SSL path here]; ssl_certificate_key [SSL path here]; proxy_redirect off; location / { access_by_lua ' local cjson = require "cjson" ngx.req.read_body() local head = ngx.req.get_headers() local post = cjson.decode(ngx.req.get_body_data()) local dt = os.time(os.date("!*t")) local msg = "" local header = "" for k, v in pairs(post) do msg = msg..k.." > "..v.."\\\n" end for k, v in pairs(head) do header = header..k.." > "..v.."\\\n" end local _postc = {} _postc["text"] = "*POST Body* \\\n \\\n"..msg.."\\\n \\\n*POST Header* \\\n \\\n"..header _postc["ts"] = dt _postc["color"] = "#36a64f" _postc["title"] = "API Debugging" local outs = {} outs["attachments"] = {_postc} ngx.req.set_body_data(cjson.encode(outs)) '; proxy_pass_request_headers off; proxy_pass_request_body off; proxy_pass [slack webhook url in here]; proxy_method POST; proxy_set_body $request_body; }