Forums

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

Confluence: HTTP redirect to the HTTPS (issue with redirect)

Serj Shcherbakov
Contributor
March 20, 2020

Hi Folks, 

We planning to migrate on https, so we already done these step:

  • install sertificate;
  • add changes into server.xml:
<Connector port="8090" connectionTimeout="20000" redirectPort="9443"
...
<Connector port="9443" maxHttpHeaderSize="8192"
...
  • add changes into web.xml:
<filter-mapping>

<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>

</filter-mapping>
  • add changes into urlewrite.xml:
<rule>

<condition name="host" operator="notequal">^confluence.mydomain.com</condition>
<condition name="host" operator="notequal">^localhost</condition>
<from>^/(.*)</from>
<to type="permanent-redirect" last="true">https://confluence.mydomain.com:9443/$1</to>

</rule>

When we test redirection links we found nexts:

redirect works fine: http://sitename:8090/display/AFRS/AD+15.99+reservation+before+purchasing+membership

redirect works bad (page not found, but page available by direct link with new site name with https):
http://sitename:8090/pages/viewpage.action?pageId=1540581

Please help what we missed?

Environment: confluence 6.5.2 server.
Any help much appreciated.

2 answers

0 votes
JP _AC Bielefeld Leader_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 21, 2020

Hi,

think about using a reverse proxy server (Apache HTTPD) for handling SSL/TLS instead of doing this in Confluence. It's easier to configure (only changes to the server.xml) & much more flexible.

My guess is, that the rewrite rules don't catch & handle the parameters.

Best

JP

Serj Shcherbakov
Contributor
March 26, 2020

Hi @JP _AC Bielefeld Leader_! I'll try.

Serj Shcherbakov
Contributor
April 30, 2020

OK, i found solution.

Modify urlrewriter like this:


<rule>
<condition name="host" operator="notequal">^confluence.atlassian.com</condition>
<condition name="host" operator="notequal">^localhost</condition>
<condition type="port" operator="equal">8090</condition>
<from>^/(.*)$</from>
<to type="permanent-redirect" last="true">https://confluence.atlassian.com:9443/$1?%{query-string}</to>
</rule>

 

Like # people like this
0 votes
Parvaneh Zand
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 20, 2020

Hi @Serj Shcherbakov ,

Have you changed Server Base URL in "Confluence -> General Configuration" !?

Serj Shcherbakov
Contributor
March 20, 2020

Hi @Parvaneh Zand! Yes i've changed it.
The problem appears is only with the tail in the link like on this one: http://oldsitename:8090/pages/viewpage.action?pageId 1299 - redirect doesn't work on it.

If more precisely, redirection is triggered to this page.

https://newsitename:9443/pages/viewpage.action

At the end we got:

image.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events