Hello,
I followed the documentation for using NGINX to reverse proxy to port 80, however, when I go to the FQDN without the port, I receive the default NGINX page. This may have to do with the example using www.example.com/conflunece, while ours is confluence.domain.com. Could anyone assist me with this? I'm setting up a POC for us. Management does not want to have to remember the port number to append it to the URL.
Hi Neil,
Based on the instructions here: https://confluence.atlassian.com/confkb/how-to-use-nginx-to-proxy-requests-for-confluence-313459790.html, and assuming you are on Confluence 6.0+) try something like this in your NGINX server block (replace your-domain.com with your POC domain):
your-domain.com
server { listen confluence.your-domain.com:80; server_name confluence.your-domain.com; 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://localhost:8090; } location /synchrony { 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://localhost:8091/synchrony; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; } }
Make sure the context path in <CONFLUENCE-INSTALL>/conf/server.xml is empty (i.e. not "/confluence"):
<CONFLUENCE-INSTALL>/conf/server.xml
/confluence"
<Context path="" docBase="../confluence" debug="0" reloadable="false">
Make sure proxyName and proxyPort are set in <CONFLUENCE-INSTALL>/conf/server.xml:
proxyName
proxyPort
<Connector port="8090" connectionTimeout="20000" redirectPort="8443" maxThreads="48" minSpareThreads="10" enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8" protocol="org.apache.coyote.http11.Http11NioProtocol" proxyName="confluence.your-domain.com" proxyPort="80"/>
Hope this helps.
Sam
Sam,
Thank you for the help. I'm still having an issue though. When visiting the page without the port I'm getting "This site can’t be reached, confluence.domain.com refused to connect." I can still access it via :8090 though.
Edit: Nevermind, for some reason, it wasn't running. I started the service and it is working properly now. Thank you again!
I got the site up and working, however, now there are issues with editing anything on the Wiki. There was issues with Synchrony, so I disabled collaborative editing, but there's also issues when trying to select page templates and use macros. Any idea why?
The above was running reverse proxy with NGINX over SSL. I have since switched to mod_proxy with apache. Everything is working at the moment, but I'm going to try and use SSL as well.
For SSL with NGINX you'd need to update a couple of things.
Make sure proxyName is set to "443" and scheme is set to "https" in <CONFLUENCE-INSTALL>/conf/server.xml. Something like:
"443"
"https"
<Connector port="8090" connectionTimeout="20000" redirectPort="8443" maxThreads="48" minSpareThreads="10" enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8" protocol="org.apache.coyote.http11.Http11NioProtocol" proxyName="confluence.your-domain.com" proxyPort="443" scheme="https"/>
Then you'd have to set up your NGNIX server block something like the example given at https://confluence.atlassian.com/doc/running-confluence-behind-nginx-with-ssl-858772080.html, but adjusted to use a sub-domain, rather than a "/confluence" context path. Something like:
"/confluence"
server { listen confluence.your-domain.com:80; server_name confluence.your-domain.com; listen 443 default ssl; ssl_certificate /usr/local/etc/nginx/ssl/nginx.crt; ssl_certificate_key /usr/local/etc/nginx/ssl/nginx.key; ssl_session_timeout 5m; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; 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://localhost:8090; } location /synchrony { 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://localhost:8091/synchrony; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; } }
A Confluence and NGINX restart would be needed after making these changes.
It looks like you're new here. Sign in or register to get started.