Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Redirecting HTTP to HTTPS in Confluence not working, what did I miss?

Paul Vreugdenhil November 6, 2019

I have followed the directions to run Confluence over SSL (https://confluence.atlassian.com/doc/running-confluence-over-ssl-or-https-161203.html) and I can't get the redirect to work. In my server.xml file I have:

<Connector port="80" connectionTimeout="20000" redirectPort="8443"
maxThreads="200" minSpareThreads="10"
enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"
protocol="org.apache.coyote.http11.Http11NioProtocol"/>

and

<Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="200" minSpareThreads="25"
protocol="org.apache.coyote.http11.Http11Nio2Protocol"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLSv1.2" sslEnabledProtocols="TLSv1.2" SSLEnabled="true"
URIEncoding="UTF-8" keystorePass="changeit" keystoreFile="C:\Program Files\Atlassian\confluence.keystore"/>

 

In my web.xml file I added:

<security-constraint>
<web-resource-collection>
<web-resource-name>Restricted URLs</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport_guarantee>CONFIDENTIAL</transport_guarantee>
</user-data-constraint>
</security-constraint>

 

I restarted Confluence and now I can access with HTTP and I can access with HTTPS but HTTP is not redirecting to HTTPS. Can you tell me what I have missed?

 

2 answers

0 votes
Paul Vreugdenhil November 7, 2019

I found my own problem. I had 

<transport_guarantee>

instead of

<transport-guarantee>
Brant Schroeder
Community Champion
November 7, 2019

Great

0 votes
Brant Schroeder
Community Champion
November 6, 2019

The only thing that I can see is your URL pattern is /* instead of / as in the documentation.  /* on a servlet overrides all other servlets while / doesn't override any other servlet.  Both should technically redirect but you might make the change and see if that resolves your issue.

Paul Vreugdenhil November 7, 2019

I did try using the / as in the documentation but that also did not work. I tried using /* based on a suggestion in another community thread. It is as if the web.xml code I added is being ignored.

Brant Schroeder
Community Champion
November 7, 2019

Paul,

Is the <security-constraint> before end of web.xml file just above: </web-app> ?

Paul Vreugdenhil November 7, 2019

Yes. The end of my web.xml file looks like this:

<error-page>
<exception-type>com.atlassian.sal.api.permission.NotAuthenticatedException</exception-type>
<location>/login.action</location>
</error-page>
<error-page>
<exception-type>com.atlassian.sal.api.permission.AuthorisationException</exception-type>
<location>/notpermitted.action</location>
</error-page>

<!-- http redirect to https -->
<security-constraint>
<web-resource-collection>
<web-resource-name>Restricted URLs</web-resource-name>
<url-pattern>/</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport_guarantee>CONFIDENTIAL</transport_guarantee>
</user-data-constraint>
</security-constraint>
</web-app>
Brant Schroeder
Community Champion
November 7, 2019

What is your base url and do you have proxy setup?

Paul Vreugdenhil November 7, 2019

My server base url in the Confluence General Configuration is in the format https://domain.name.com. I don't have a proxy setup. Apart from trying to set-up SSL, I have a new stock Confluence install.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events