読者です 読者をやめる 読者になる 読者になる

nginx POST body ログ 取得

vi /etc/nginx/conf.d/forward_proxy.conf

server {
    listen 8080;
    server_name 【LOCAL_IP】;
    resolver 【DNS_IP】;
    location / {
        proxy_pass $scheme://$http_host$request_uri;
    }
}

vi /etc/nginx/nginx.conf

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'
'POST[$request_body]';