• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Logging POST data not working

gennolo

Basic Pleskian
I am using Plesk Obsidian on a Centos 7 VPS.

I occasionally have the need to log POST data in received in web requests.

I tried following this guide which says to use "mod_dumpio" (which is already active in Plesk in the server's Apache modules).

I then inserted :

Code:
DumpIOInput On
DumpIOOutput On
LogLevel dumpio:trace7

in the "Apache additional directives" for my domain both for HTTP / HTTPS,
then I restarted httpd and sent a POST request to the server, but nothing appears in the logs for the involved domain.

Am I doing something wrong?
 
Hi,

I'm trying to log POST HTTP requests data too. Proxy mode is enabled, so only Nginx is used.

I have found that the needed configuration at Nginx.conf is :

log_format post_logs '[$time_local] "$request" $status '
'$body_bytes_sent "$http_referer" '
'"$http_user_agent" [$request_body]';

access_log /var/log/nginx/access.log post_logs;


But I'm getting the following error at Plesk "Apache & nginx Setting" of my Webspace :

Invalid nginx configuration: nginx: [emerg] "log_format" directive is not allowed here in /var/www/vhosts/system/applicarte.abidjan.net/conf/vhost_nginx.conf:153 nginx: configuration file /etc/nginx/nginx.conf test failed

Can any one help to log POST DATA for a subscription at plesk?

Thank you
 
Yeah, it's just not allowed in the A + N settings. You can edit the nginx configuration files directly. It'll be overwritten, but this should only be a temporary change anyways. It should be in /var/www/vhosts/system/<domain>/conf
 
Yeah, it's just not allowed in the A + N settings. You can edit the nginx configuration files directly. It'll be overwritten, but this should only be a temporary change anyways. It should be in /var/www/vhosts/system/<domain>/conf
Thank you for your help! I was looking for the link /var/www/vhosts/system/<domain>/conf/nginx.conf. I could log the body of post requests when adding the needed configuration at /var/www/vhosts/system/<domain>/conf/nginx.conf !

What is the condition that overwrite the file var/www/vhosts/system/<domain>/conf/nginx.conf ?

N.B: "access_log /var/www/vhosts/system/<domain>/access.log post_logs; "should be at "server " section.
 
Back
Top