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 ,
have you tried
<VirtualHost aaa.bbb.ccc.ddd:8080>
ServerName http://aaa.bbb.ccc.ddd:8080
Redirect 301 / https://jira.mysubdomain.com/
</VirtualHost>
In the end this a redirect from http to https. Just took this snippet from you original post.
So long
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear @UJ ,
@Alexis Robert seems to be right. I recommend to change the port of Jira. For example to 8888. Then also adapt the reverse proxy settings. And add the 8080 with Apache to catch the request and redirect to 443.
Then you can be sure they won't access the old port.
So long
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Thomas Deilerand @Alexis Robert : ah, now I understand why my redirect doesn't work.
Changing the port for Jira is a good idea! I will check this out.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Somehow this doesn't really work out. Now I just removed the port from the firewall. Not such an elegant solution but I have spent enough time with it :) Thanks @Thomas Deiler and @Alexis Robert for the help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can simply do this using your htaccess file.
Here is the code to redirect IP to domain
RewriteEngine on
RewriteCond %{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/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.