Welcome! Log In Create A New Profile

Advanced

Losing POST data on vanilla Ubuntu/nginx/mongrel install

Aaron Starr
April 03, 2009 05:22PM
Hi, all. Sorry in advance for what is hopefully a simple question.

I'm using nginx as a reverse-proxy for a few mongrel instances. Using
AJAX (XMLHttpRequest), I POST a small bit of JSON to the server. The
request is properly proxied to mongrel, but with the POST data
missing!

(I.e., in the rails controller, request.env['RAW_POST_DATA'] and
reqest.raw_post are empty.)

When I take nginx out of the mix, by POSTing directly to mongrel, it
works fine. And, it was working fine before when going through nginx,
but some mysterious change happened in the last couple of days, and
now I usually see the problem.

Anyone have any ideas?


Versions:

mongrel 1.1.5
mongrel cluster 1.0.5
nginx 0.7.9
Ubuntu 8.04.1

Configuration:

user www www;
worker_processes 1;

error_log logs/error.log error;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;
access_log logs/access.log;

sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
tcp_nodelay on;

gzip on;
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_types text/plain text/javascript application/x-javascript;

upstream mongrel {
server 127.0.0.1:3000;
server 127.0.0.1:3001;
server 127.0.0.1:3002;
server 127.0.0.1:3003;
server 127.0.0.1:3004;
}

server {
listen 80;
server_name wiredquote.com;
root /opt/apps/benefits/public;
index index.html;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect false;
if (-f $request_filename) {
break;
}
if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
if (-f $request_filename.html) {
rewrite (.*) $1.html break;
}
if (!-f $request_filename) {
proxy_pass http://mongrel;
break;
}
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
Subject Author Posted

Losing POST data on vanilla Ubuntu/nginx/mongrel install

Aaron Starr April 03, 2009 05:22PM

Re: Losing POST data on vanilla Ubuntu/nginx/mongrel install

Aaron Starr April 04, 2009 03:49AM

Re: Losing POST data on vanilla Ubuntu/nginx/mongrel install

Maxim Dounin April 04, 2009 10:38AM

Re: Losing POST data on vanilla Ubuntu/nginx/mongrel install

Aaron Starr April 04, 2009 06:55PM

Re: Losing POST data on vanilla Ubuntu/nginx/mongrel install

Dave Cheney April 05, 2009 01:55AM

Re: Losing POST data on vanilla Ubuntu/nginx/mongrel install

Maxim Dounin April 05, 2009 06:56AM

Re: Losing POST data on vanilla Ubuntu/nginx/mongrel install

Aaron Starr April 05, 2009 11:28PM

Re: Losing POST data on vanilla Ubuntu/nginx/mongrel install

Aaron Starr April 08, 2009 07:37PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 102
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready