Enable SSL with AWS ELB and Confluence
Asked by Troy Moreland:

I am successfully running Confluence (and Jira) in AWS behind ELB (elastic load balancer) instances. On the ELB there is an HTTP (80) listener to the EC2 instance on the HTTP port for Confluence (8090). This works great. However, I want to use SSL on the ELB side. When I change the listener on the ELB that works but Confluence redirects back to port 80 which then fails since the ELB is no longer listening on that port. I tried changing the base URL and I tried adding proxyPort to the server.xml file. I haven't found a combination that works.


Answers:
author: Brian Harris
body: This worked for us <https://confluence.atlassian.com/confkb/how-to-configure-amazon-web-service-elastic-load-balancer-with-confluence-6-0-859515417.html>


author: Tom Jackson
body: I got this working. The key is in fact your server.xml. I use the following xmlstarlet commands in my Confluence dockerfile to inject the needed attributes:

# configure Confluence for use behind an ELB by adding proxy-related attributes to server.xml  
RUN xmlstarlet ed --inplace --insert "/Server/Service/Connector" --type attr -n scheme -v https $CONFLUENCE_INSTALL/conf/server.xml  
RUN xmlstarlet ed --inplace --insert "/Server/Service/Connector" --type attr -n proxyPort -v 443 $CONFLUENCE_INSTALL/conf/server.xml  
RUN xmlstarlet ed --inplace --insert "/Server/Service/Connector" --type attr -n secure -v true $CONFLUENCE_INSTALL/conf/server.xml

comments: author: Milind Shah
body: I tried that out but it did not work.

i updated the server xml to include the 3 variables mentioned adove but that still does not let https work through AWS ELB

|------------------------|--------------------|-------------------|---------------|--------|--------------------------------------------|
| Load Balancer Protocol | Load Balancer Port | Instance Protocol | Instance Port | Cipher | SSL Certificate                            |
| HTTP                   | 80                 | HTTP              | 8080          | N/A    | N/A                                        |
| HTTPS                  | 443                | HTTP              | 8080          |        | 3a9009dd-7216-458e-8b65-9e2cdf9ae24b (ACM) |

Server XML:

\<Service name="Catalina"\>

\<Connector port="8080"

maxThreads="150"  
minSpareThreads="25"  
connectionTimeout="20000"  
enableLookups="false"  
maxHttpHeaderSize="8192"  
protocol="HTTP/1.1"  
useBodyEncodingForURI="true"  
acceptCount="100"  
disableUploadTimeout="true"  
redirectPort="8443"  
**scheme="https"**   
**proxyPort="443"**   
**secure="true"**   
/\>


author: Milind Shah
body: HI Troy, Were you able to get this to work based on the link provided below by Renato?

I have a similar setup, where ELB port 80 points to instance port 8080 for JIRA, however the same does not work when setting up a https port via ELB and using a AWS Certificate.

Please let me know

Thanks

Milind Shah


author: Tom Jackson
body: @Troy Moreland, did you get this to work?


author: rrudnicki
body: Hi Troy,

I believe it is failing because your ELB is listening on port 443 but when Confluence send the information back, it is done by a different port. So, the ELB receive the connection from Confluence on port 80 when the expected is on port 443. So, I believe that if we configure Confluence to only listen on port 443 it should works. Can you have a look on [this link](https://confluence.atlassian.com/display/DOC/Change+listen+port+for+Confluence) and let us know how it is going?

In case it doesn't work, please paste the server.xml here.

Regards,

Renato Rudnicki


Tags: confluence-administration