Welcome! Log In Create A New Profile

Advanced

POST causes segfault (502 'upstream prematurely closed connection')

August 04, 2009 07:32AM
I'm stuck trying to find the culprit for an apache segfault.

I have nginx set up on one server for 2 types of site; 'normal' apache sites and wordpress fcgi sites.
The normal apache sites have started to fail on file uploads via the html file form field.

Here is an example config proxying onto apache:

Domain specific MYSITE.conf:
[code]
server {
server_name www.MYSITE.co.uk;
access_log /var/log/nginx/MYSITE-access.log;
root /var/www/MYSITE;

# Default proxy settings
include /etc/nginx/conf/generic-vhost.conf;

# Static file serving
include /etc/nginx/conf/serve-static-files.conf;
}
[/code]
generic-vhost.conf;
[code]
listen PUBLIC_IP:80;
client_max_body_size 25m;
client_body_buffer_size 128k;

location = /internal_server_error.html {
internal;
root /var/www/nginx;
}

location = /too_many_connections.html {
internal;
root /var/www/nginx;
}

location / {
proxy_pass http://127.0.0.1:80/;
proxy_redirect default;
proxy_set_header Host $host;
set_real_ip_from OTHER_PUBLIC_IP;
real_ip_header X-Real-IP;

proxy_set_header X-Real-IP $proxy_add_x_forwarded_for;
proxy_set_header SERVER_PORT $server_port;

# client_max_body_size 25m;
# client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
[/code]



serve-static-files.conf;
[code]
location ^~ /shared/ {
alias /var/www/shared/;
if (!-f $request_filename) {
proxy_pass http://127.0.0.1:80;
}
}


# List of extensions that we want to serve using nginx
location ~* ^.+.(jpe?g|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|swf|avi|mp3|tif?f|htc|js)$ {
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
if (!-f $request_filename) {
# File not found on disk so let apache deal with the request
break;
proxy_pass http://127.0.0.1:80;
}
}
[/code]

The nginx access log file shows a 502 response, and Apache doesn't register a hit.

Nginx error log: "upstream prematurely closed connection while reading response header from upstream"]
Apache log: " [notice] child pid 5566 exit signal Segmentation fault (11)"

[code]nginx -V
nginx version: nginx/0.7.59
built by gcc 4.1.2 20080704 (Red Hat 4.1.2-44)
configure arguments: --with-http_realip_module
[/code]

Any suggestions on where to track down this error?
Subject Author Posted

POST causes segfault (502 'upstream prematurely closed connection')

miradev August 04, 2009 07:32AM

Re: POST causes segfault (502 'upstream prematurely closed connection')

Maxim Dounin August 06, 2009 04:46PM

Re: POST causes segfault (502 'upstream prematurely closed connection')

miradev August 12, 2009 08:18AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 299
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