Problem:
Confluence 6 behind Nginx:
I am using the following nginx config:
server {
listen 80;
listen [::]:80;
server_name confluence.yourhost.com;
location /confluence {
set $backend "http://confluence:8090";
proxy_pass $backend;
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;
}
location /synchrony {
set $backend "http://confluence:8091/synchrony";
proxy_pass $backend;
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_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}Nearly the same as in the Atlassian documentation:
Is this really working or do I have (and how) to reconfigure synchrony?
Hello, I finally was able to get the configuration running!
I changed:
location /synchrony {
set $backend "http://confluence:8091/synchrony";location /synchrony {
set $backend "http://confluence:8091";My reverse proxy configuration:
location /synchrony {
set $backend "http://confluence:8091";
proxy_pass $backend;
proxy_redirect http://confluence:8091 $scheme://$host/;
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_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location / {
set $backend "http://confluence:8090";
proxy_pass $backend;
proxy_redirect http://confluence:8090 $scheme://$host/;
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;
}My docker command and community image:
$ (Added confluence.yourhost.com to my /etc/hosts)
$ docker network create confluence
$ docker run -d --name confluence \
--hostname confluence \
--network confluence \
-v confluencedata:/var/atlassian/confluence \
-e "CONFLUENCE_PROXY_NAME=confluence.yourhost.com" \
-e "CONFLUENCE_PROXY_PORT=80" \
-e "CONFLUENCE_PROXY_SCHEME=http" \
blacklabelops/confluence
$ docker run -d \
-p 80:80 \
--name nginx \
--network confluence \
-e "SERVER1SERVER_NAME=confluence.yourhost.com" \
-e "SERVER1REVERSE_PROXY_LOCATION1=/synchrony" \
-e "SERVER1REVERSE_PROXY_PASS1=http://confluence:8091" \
-e "SERVER1REVERSE_PROXY_APPLICATION1=confluence6" \
-e "SERVER1REVERSE_PROXY_LOCATION2=/" \
-e "SERVER1REVERSE_PROXY_PASS2=http://confluence:8090" \
-e "SERVER1REVERSE_PROXY_APPLICATION2=confluence" \
blacklabelops/nginxConfluence is accessible under: http://confluence.yourhost.com
I can confirm that the above works for SSL offloading as well ![]()
Most import bit is this:
proxy_redirect http://localhost:8090 $scheme://$host/; AND proxy_redirect http://localhost:8091 $scheme://$host/;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Note that if you use variables in the proxy_pass line, as in the example above, you also HAVE to set a resolver line.
http://stackoverflow.com/questions/17685674/nginx-proxy-pass-with-remote-addr
http://www.nginx-discovery.com/2011/05/day-51-proxypass-and-resolver.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I am facing the same problem after upgrading to confluence 6.
I don't use a context path in my tomcat installation.
I copied your solution (instead of the "proxy_redirect" and "proxy pass" which I changed to the adress to 127.0.0.1 to get rid of the resolver, and I use SSL instead of port 80).
Unfortunately synchrony is not working. It hangs with the known error message "Loading the editor's taking longer than usual. Give it a few moments, then refresh your page if it still doesn't load. Speak to your Confluence admin if that doesn't fix it."
Am I missing something? Do I need a context path in Tomcat?
My nginx config. I removed most of the ssl parameters and changed the servername:
server {
listen 80;
server_name server.example.com;
root /var/www/;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
rewrite ^ https://$host$request_uri? permanent;
}
# HTTPS server
#
server {
listen 443;
server_name server.example.com;
root /var/www/;
access_log /var/log/nginx/ssl-access.log;
error_log /var/log/nginx/ssl-error.log;
location /synchrony {
set $backend "http://127.0.0.1:8091";
proxy_pass $backend;
proxy_redirect http://127.0.0.1:8091 $scheme://$host/;
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_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location / {
set $backend "http://127.0.0.1:8090";
proxy_pass $backend;
proxy_redirect http://127.0.0.1:8090 $scheme://$host/;
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;
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, i'm facing the same problem. If i disable internal confluence proxy and open the port 8091 to the clients, synchrony works. It is not an expected behaviour but it is a workaround, i think. With internal proxy my problem is that localhost:8091 is unreachable because of docker installation. So i need either to access the synchrony via internal proxy and specific hostname (eg. confluence:8091) or to configure the confluence to use a diffrent port for accessing context path /synchrony via nginx proxy and external url like http://confluence.my.company:80/synchrony.
My post is here: https://answers.atlassian.com/questions/44084117
Regards, Gena
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry,
There was a typo in my comment. It's heartbeat not hearbeat. I updated the comment above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is no such page on Confluence 5 or 6...
I fixed the localhost issue by properly configuring the Confluence base url inside the administration page. Now the editor opens and I can press menu item buttons but everything else "gets stucked" and the contents of the page is not loaded.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you check if the Synchrony heartbeat URL is reachable via one of these 2 URL?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nginx and confluence are not on the same host! Confluence is reachable and accessable!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Steffen Buehl,
I see that you use "confluence" as the hostname in the proxy_pass parameters "http://confluence:8091/confluence" and "http://confluence:8091/synchrony". If you are running Nginx on the same host of Confluence. Would you please replace "confluence" with "localhost" and try again?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After looking into chrome developers console I have to adjust the question:
Synchrony is still requesting from url: http://localhost:8090/. How can I reconfigure synchrony?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.