Nginx double requests for my upstreams?
funkdoobiest
nginx-forum at nginx.us
Fri Jun 5 15:59:13 MSD 2009
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:
#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;
}
# 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;
#upstream.conf
upstream webseite {
ip_hash;
server 10.XXX.XX.1:8081;
server 10.XXX.XX.2:8081;
server 10.XXX.XX.3:8081;
}
#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;
}
}
Thank you!
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,2644,2644#msg-2644
More information about the nginx
mailing list