After long time using different Atlassian products I have set up subdomains for all of them. Now users can still access with the IP address (e.g. jira: aaa.bbb.ccc.ddd:8080), but you get (of course) an error message because of the wrong base URL. Since some users have stored the IP address in their browser or address book I want to have a redirection to the subdomain:
aaa.bbb.ccc.ddd:8080 -> jira.mysubdomain.com
I've tried Apache Redirect for that without success:
<VirtualHost *:8080> ServerName http://aaa.bbb.ccc.ddd:8080 Redirect 301 / https://jira.mysubdomain.com/</VirtualHost>
Is it possible anyway, because of the reverse proxy? (https://confluence.atlassian.com/kb/proxying-atlassian-server-applications-753894340.html#ProxyingAtlassianServerapplications-ConnecttoyourapplicationviaaReverseProxyoverHTTP)
Is there a built in solution for Jira, Confluence or Bitbucket?
system: Ubuntu 18.04 server, latest confluence, jira and bitbucket. SSL and reverse proxy active.
Dear @UJ ,
sure this is possible. Follow this article and also read the comments.
So long
Thomas
Hi @UJ ,
unfortunately you won't be able to use Apache to redirect users, since Apache is probably listening on ports 80 and 443 and your users are reaching port 8080 directly.
You could probably set up an iptable rule however, for example this post might help.
Let me know if this works,
--Alexis
Hmm. I don't want to redirect from http to https but IP:port to domain.I also read the comments and nobody describes my case.
have you tried
<VirtualHost aaa.bbb.ccc.ddd:8080>ServerName http://aaa.bbb.ccc.ddd:8080Redirect 301 / https://jira.mysubdomain.com/</VirtualHost>
In the end this a redirect from http to https. Just took this snippet from you original post.
Hi @Thomas Deiler ,
this won't work because users will not hit Apache (see my comment above) as they directly hit Tomcat with 8080 port. Apache only listens on ports 80 and 443, it won't be able to catch anything on 8080 (as it's used by Tomcat for Jira ...).
You can simply do this using your htaccess file.
Here is the code to redirect IP to domain
RewriteEngine onRewriteCond %{HTTP_HOST} ^1\.1\.2\.3$RewriteRule (.*) https://sub.example.com/$1 [L,R=301]
Replace ip with your domain ip.
If you want to learn URL rewriting , you can follow this tutorial https://amitoverflow.com/2021/04/15/htaccess-tutorial-for-beginers/
It looks like you're new here. Sign in or register to get started.