https faild; redirect to http

I Stash is installed on a remote server that is accessed via Apache (proxy).

Under https://example.com/stash want the server to be accessible. Calling the URL I will reflect back at http://example.com/stash/login, but there is no stash installed.

Apache:

<VirtualHost example.com:443>

  SSLEngine On
  SSLCertificateFile /etc/apache2/ssl/apache.crt
  SSLCertificateKeyFile /etc/apache2/ssl/apache.key
  ServerSignature Off

  # Atlassian Stash Configuration
  ProxyPass        /stash http://localhost:7990/stash connectiontimeout=5 timeout=300
  ProxyPassReverse /stash http://localhost:7990/stash

</VirtualHost>


Tomcat (conf/server.xml)

...
<Service name="Catalina">
...
     <Connector port="7990"
                protocol="HTTP/1.1"
                connectionTimeout="20000"
                useBodyEncodingForURI="true"
                redirectPort="443"
                compression="on"
                compressableMimeType="text/html,text/xml,text/plain,text/css,...
                secure="true"
                schema="https"
                proxyName="developer.kirchnerei.de"
                proxyPort="443"/>

...

            <Host name="localhost" appBase="webapps"
                  unpackWARs="true" autoDeploy="true"
                  xmlValidation="false" xmlNamespaceAware="false">
...
               <Context path="/stash"
                         docBase="${catalina.home}/atlassian-stash"
                         reloadable="false"
                         useHttpOnly="true"/>
...
            </Host>


...
</Service>

How to config Stash to access only over https?
Thanks

2 answers

1 accepted

This widget could not be displayed.

Hi Mulder,

Under https://example.com/stash want the server to be accessible. Calling the URL I will reflect back athttp://example.com/stash/login, but there is no stash installed.

This tells me that your Apache server is configured correctly, but Tomcat seems to think it's running on http, not https. You can confirm this by opening https://developer.kirchnerei.de/stash/login directly. If a Stash page shows up, it confirms that the Apache configuration is fine. When you actually login, Stash will redirect you to http://developer.kirchnerei.de/stash/projects which will not work (because of the http instead of https).

Your Tomcat configuration looks fine; we're using the same configuration internally for our Stash dogfooding server. Are you sure you're modifying the correct server.xml? If you're running Stash from the bundled Tomcat server, it should be the STASH_INST/conf/server.xml.

Cheers,

Michael

Hi Michael,

thanks for your answer. I reinstall stash again and I use the Documentation https://confluence.atlassian.com/display/STASH/Integrating+Stash+with+Apache+HTTP+Server.

And magic ... I got it to run...

Cheers,

Sarah

This widget could not be displayed.

Hi Mulder

If Apache is the front-end server, all you have to do is keep this configuration and do not configure the "<Vistualhost> " settings for port 80 (clear text).

However, if you might having the following settings, you should change the Stash setting in order to bind a SSL port too, installing a new certiicate and so on. For further details, please use the following page as your guideline.

Envrionment:

Client Browser --> HTTPS --> Apache proxy --> HTTPS --> Tomcat/STASH

For further details:

https://confluence.atlassian.com/display/STASH/Securing+Stash+with+HTTPS

Cheers,

Paulo Renato

Hi Paulo,

I am sorry, but I need more information.

There are 2 help documents

But I can find the solution. do you have a example configuration?

Thanks a lot

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted 36m ago in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

8 views 0 1
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you