Confluence behind the nginx with SSL
Asked by Frankie:

I'd like to install confluence behind the nginx with ssl support, so my scheme is:

**user -\> nginx** **(https) -\> tomcat (http)**

Could you please show me correct nginx and tomcat configs for this purpose.

Thanks.


Answers:
author: Fabio Racobaldo _Herzum_
body: Hi Frankie,

in order to do that you need to perform the following operation :

- Set Confluence context path

Edit the following file \<CONFLUENCE_INST_FOLDER\>/conf/server.xml, locate "Context" and add the context path (eg ... path="/confluence" ...)

- Set the proxy to the Connector

Edit the following file \<CONFLUENCE_INST_FOLDER\>/conf/server.xml, and add your proxy  
`<Connector port=``"8090"` `maxHttpHeaderSize=``"8192"`  
` ``maxThreads=``"150"` `minSpareThreads=``"25"` `maxSpareThreads=``"75"`  
` ``enableLookups=``"false"` `redirectPort=``"8443"` `acceptCount=``"100"`  
` ``connectionTimeout=``"20000"` `disableUploadTimeout=``"true"`  
` ``proxyName=``"www.example.com"` `proxyPort=``"80"` `/>`  
- Setup you NGNIX  
Set the following :  
server {  
listen [www.example.com:443;](http://www.example.com:443;)  
ssl on;  
ssl_certificate /path/to/self-ssl.crt;  
ssl_certificate_key /path/to/self-ssl.key;  
server_name theos.in;  
location / {  
....  
...  
proxy_pass <http://localhost:8090/confluence;>  
}  
}  

Please follow this tutorial [](http://www.cyberciti.biz/faq/nginx-self-signed-certificate-tutorial-on-centos-redhat-linux/)<http://www.cyberciti.biz/faq/nginx-self-signed-certificate-tutorial-on-centos-redhat-linux/>  
- Update Confluence URL accordingly  
Confluence Administration -\> General Configuration

comments: author: Frankie
body: `<Connector port=``"8090"` `maxHttpHeaderSize=``"8192"`  
` ``maxThreads=``"150"` `minSpareThreads=``"25"` `maxSpareThreads=``"75"`  
` ``enableLookups=``"false"` `redirectPort=``"8443"` `acceptCount=``"100"`  
` ``connectionTimeout=``"20000"` `disableUploadTimeout=``"true"`  
` ``proxyName=``"www.example.com"` `proxyPort=``"80"` `/>`  
Is it correct ? Because **nginx** **(https)** maybe **proxyPort="443"** and what about **scheme** param, or i have some misunderstanding you**.**   

Also, i have the same bug as in [](https://jira.atlassian.com/browse/CONF-28564)<https://jira.atlassian.com/browse/CONF-28564>, does it related to correct tomcat/nginx configuration ?


author: Fabio Racobaldo _Herzum_
body: proxy name and proxy port should be setup based on your nginx configuration.

proxyName=""www.example.com" proxyPort="443"

where [](http://www.example.com)[www.example.com](http://www.example.com)is the URL configured in your NGINX


author: Fabio Racobaldo _Herzum_
body: Remember that after updating server.xml you need to restart confluence


author: Kenric
body: Has anyone gotten this to work?

thanks

comments: author: David Di Blasio
body: Hi Kenric, I have Nginx set up in front of one of my Confluence instances to terminate SSL and it's working beautifully. Do you have any specific questions regarding setting it up?


author: Karl Bateman
body: Hi @Fabio,

I have followed your instructions, but I recieve a 400 Error from NGINX stating that "The plain HTTP request was sent to HTTPS port".  
Do you have any ideas?  
Regards,  
Karl

comments: author: Marcel Mayer
body: I am running in the same issue. Did you solved the problem?


author: Fabio Racobaldo _Herzum_
body: Remember that after updating server.xml you need to restart confluence


Tags: confluence-administration