-
-
Save danslimmon/17f5bf4736566737cc65 to your computer and use it in GitHub Desktop.
This file contains 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 characters
http { | |
log_format mylogfmt '$remote_addr - $remote_user [$time_local] \ | |
"$request" $status $body_bytes_sent "$http_referer" \ | |
"$http_user_agent" "$foo"' | |
} | |
location / { | |
proxy_pass http://remote-server.example.com/; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_connect_timeout 150; | |
proxy_send_timeout 100; | |
proxy_read_timeout 100; | |
proxy_buffers 4 32k; | |
client_max_body_size 8m; | |
client_body_buffer_size 128k; | |
rewrite_by_lua ' | |
cjson = require "cjson" | |
ngx.req.read_body() | |
body_table = cjson.decode(ngx.var.request_body) | |
ngx.var.foo = body_table["foo"] | |
'; | |
access_log /var/log/nginx/access.log mylogfmt; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment