Welcome! Log In Create A New Profile

Advanced

Nginx truncate long request

Posted by pszmagaj 
Nginx truncate long request
May 19, 2011 07:39AM
Dear Colleagues,

I have problem with nginx + php5-fpm which truncate long requests. If request POST data is longer than about 24kB not complete POST is sent to php process. I have nginx 1.0.2 installed on Ubuntu and nginx 0.8.54 installed on Debian Lenny and on both systems I experience same problem. I have never have that problem on nginx 0.8 and php installed on Windows. This is not a matter of permissions to proxy_temp directory which are correct (even when 777 is set problem still occurs, moreover permission denied was never written to error log) . I have tested many configuration settings (proxy_buffer and many fcgi settings) but nothing helped.

Could you please help me resolve that problem? Do you know what that error may be caused by?

Thanks in advance!
Paweł

Please find my nginx.conf (from ubuntu) below:


#user nobody;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;


events {
worker_connections 1024;
}


http {
include mime.types;
default_type application/octet-stream;

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

#access_log logs/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;

server {
listen 80 default;
server_name localhost;

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

location / {
root /home/pawel/public_html;
index index.php index.html;
}

location ~* ^.+.(jpg|jpeg|gif|css|png|js)$ {
access_log off;
expires max;
root /home/pawel/public_html;
}

## Parse all .php file in the /home/leon/public_html directory
location ~ .php$ {
# fastcgi_param HTTPS on;
# fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/pawel/public_html$fastcgi_script_name;
include fastcgi_params;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 180;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 1024k;
fastcgi_buffers 4 1024k;
}


# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}

}
Re: Nginx truncate long request
December 08, 2011 05:12AM
Hello,

sorry, I don't have any answer to your issue but I can only stress that I get the same thing on my server.

I have a form with long lists of multiple SELECT. When the size of submitted values reaches over 24kb, only the first 24kb of the request is used, which means the rest of the form doesn't get transmitted.
Nothing shows up in error log.

I also tried changing permissions of cache directories, changing buffer size limits and accepted body size as well but in vain.

Did anyone have this issue and found a way around ?
Re: Nginx truncate long request
December 30, 2011 05:55AM
Not sure, still getting it to work but it may come from suhosin module in PHP...
Re: Nginx truncate long request
December 30, 2011 06:30AM
In my case, it did come from Suhosin config.
Just added a few lines in PHP-FM ini file to allow more POST variables and after a reboot it seems to work just fine:

suhosin.post.max_vars=2500
suhosin.request.max_vars=2500
Re: Nginx truncate long request
December 30, 2011 06:37AM
Hello Agir,

Thanks a lot for answer. I will test it ASAP and let you know if it helps.

Paweł
Re: Nginx truncate long request
February 13, 2012 07:49PM
Did anyone have this issue and found a way around ?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 241
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready