Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Consult for load balance configuration with Nginx

dujas September 4, 2021

Hi,

We have managed to deploy a Jira Service Management cluster with 2 nodes in data center version, along with a MS SQL database and a NFS shared FS.

We are trying to deploy a load balancer/reverse proxy with Nginx in front of the 2 nodes, the reverse proxy function works well if I only configure 1 node, but once I specified the upstream(jiracluster), the website will always be redirected back to the original one, e.g.: I access the website http://azailapp01:8080/, it loads the login page successfully, but once I finish typing into the username and password and click login, it redirects back to the login page. However, if I only set the proxy_pass with one specific jira node, it works fine.

Here is the config:

nginx:

user nginx;
worker_processes auto;

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


events {
worker_connections 1024;
}


http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;

upstream jiracluster {
server azailjir01:8080;
server azailjir02:8080;
}

server {
listen 8080;
server_name azailapp01;

access_log /var/log/nginx/jira.access.log;
error_log /var/log/nginx/jira.error.log;

location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://jiracluster;
}
}
}

server.xml(identical to another jira node):

<Connector port="8080" relaxedPathChars="[]|" relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;"
maxThreads="150" minSpareThreads="25" connectionTimeout="20000" enableLookups="false"
maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443"
acceptCount="100" disableUploadTimeout="true" bindOnInit="false" scheme="http"
proxyName="azailapp01" proxyPort="8080"/>

 

2 answers

Suggest an answer

Log in or Sign up to answer
0 votes
dujas September 5, 2021
0 votes
dujas September 5, 2021

Well, though I changed the base URL to the nginx server's, still no luck.

Really need your help!

TAGS
AUG Leaders

Atlassian Community Events