Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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
Brant Schroeder Community Leader Nov 06, 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.

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 Leader Nov 07, 2019

Paul,

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

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 Leader Nov 07, 2019

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

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.

I found my own problem. I had 

<transport_guarantee>

instead of

<transport-guarantee>
Brant Schroeder Community Leader Nov 07, 2019

Great

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

383 views 23 8
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you