LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-19-2018, 10:36 PM   #1
anjo304
LQ Newbie
 
Registered: Nov 2016
Posts: 4

Rep: Reputation: Disabled
Unhappy NGINX reset established connection when upstream server goes up again.


Hello, everybody!

So, I have in my NGINX configuration an upstream with 3 server, "A", "B" and "C".
I am using "hash $remote_addr" mode, because I need direct a client’s requests to the same backend.
All is working fine, with only one inconvenient that I would like to solve.
When server "A" goes down, yours requests are send to server "B" or "C", until now that's ok, but when the server "A" goes back, it is like that claim by requests that already were yours end the client need login again. My questions are.


Are there any way to solve?

Are there any way to avoid that requests return to server A?

My NGINX configuration:


upstream firstplay {
hash $remote_addr;
server a.cer.com:443 max_fails=2 fail_timeout=5s;
server b.cer.com:443 max_fails=2 fail_timeout=5s;
server c.cer.com:443 max_fails=2 fail_timeout=5s;
}

server {
listen 443 ssl;
server_name abc.cer.com;
ssl_certificate /etc/ssl/certs/cert.crt;
ssl_certificate_key /etc/ssl/certs/cert.key;
proxy_http_version 1.1;
proxy_ssl_verify_depth 2;
proxy_ssl_session_reuse on;
proxy_connect_timeout 300;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 300;
error_log /var/log/nginx/cer-error.log;

location / {
proxy_pass https://firstplay/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
}
}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error log: upstream timed out (110: Connection timed out) on Nginx nikaway Linux - Server 1 09-30-2015 02:43 PM
NginX [error] upstream prematurely closed connection while reading reading response kingkashif Linux - Server 2 07-20-2013 04:37 PM
Install ruby gems - connection reset, connection reset..... deco81 Linux - Software 1 06-16-2010 04:47 PM
How can server find whether the connection established with client is alive yugandhar Linux - General 1 08-17-2007 10:03 AM
How to reset established connection? G-Fox Linux - Networking 4 10-02-2003 02:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration