Welcome! Log In Create A New Profile

Advanced

Nginx double requests for my upstreams?

June 05, 2009 07:59AM
Hi,

I have a strange behavior for my site load balanced with nginx.
I have 1 Loadbalancer with nginx and 3 servers with apache.

sometimes a request is doubled and send to 2 of my apache webservers.
this is a big problem for me, because this is sometimes a requests that is doing a payement.
I checked this behavior with doing a log of all my payment transactions and there a some transactions
for the same person double at the same second! (the user can't do this at the website, because I send the form which is doing the request with JS and ask the User if he really wants to pay and so on)

Here are my config files for nginx, please help me:

[code]
#ningx.conf
user www-data;
worker_processes 4;

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

#pid logs/nginx.pid;


events {
worker_connections 512;
}

http {

include mime.types;
include proxy.conf;

access_log logs/access.log combined;

sendfile on;
tcp_nopush on;

keepalive_timeout 0;
#keepalive_timeout 15;

#gzip on;


include upstream.conf;

include server_www.conf;




}
[/code]

[code]
# proxy.conf
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;

[/code]

[code]
#upstream.conf
upstream webseite {
ip_hash;
server 10.XXX.XX.1:8081;
server 10.XXX.XX.2:8081;
server 10.XXX.XX.3:8081;
}
[/code]

[code]
#server_www.conf
server {
listen 80;
server_name www.website.com;


# serve static files
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html|htm|swf)$ {
root /var/www/www.website.com/;
expires 1d;
}

location / {
proxy_pass http://webseite;
}
}
[/code]

Thank you!
Subject Author Posted

Nginx double requests for my upstreams?

funkdoobiest June 05, 2009 07:59AM

Re: Nginx double requests for my upstreams?

Maxim Dounin June 05, 2009 09:30AM

Re: Nginx double requests for my upstreams?

funkdoobiest June 07, 2009 03:35PM

Re: Nginx double requests for my upstreams?

mike June 07, 2009 03:49PM

Re: Nginx double requests for my upstreams?

Maxim Dounin June 07, 2009 04:56PM

Re: Nginx double requests for my upstreams?

funkdoobiest June 08, 2009 06:45AM

Re: Nginx double requests for my upstreams?

Maxim Dounin June 08, 2009 08:20AM

Re: Nginx double requests for my upstreams?

showrunning July 13, 2010 07:36AM

Re: Nginx double requests for my upstreams?

funkdoobiest June 22, 2009 10:19PM

Re: Nginx double requests for my upstreams?

funkdoobiest June 23, 2009 07:47AM

Re: Nginx double requests for my upstreams?

Maxim Dounin June 23, 2009 08:24AM

Re: Nginx double requests for my upstreams?

funkdoobiest June 23, 2009 10:33AM

Re: Nginx double requests for my upstreams?

Maxim Dounin June 23, 2009 10:56AM

Re: Nginx double requests for my upstreams?

funkdoobiest June 30, 2009 10:54AM

Re: Nginx double requests for my upstreams?

Maxim Dounin June 30, 2009 12:48PM

Re: Nginx double requests for my upstreams?

gelanyi1 July 13, 2010 10:15PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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