Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Redirect IP Address to Subdomain

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.

3 answers

1 accepted

0 votes
Answer accepted
Thomas Deiler Community Leader Jul 15, 2019

Dear @UJ ,

sure this is possible. Follow this article and also read the comments.

So long

Thomas

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.

Thomas Deiler Community Leader Jul 15, 2019

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

Alexis Robert Community Leader Jul 15, 2019

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 ...).

Thomas Deiler Community Leader Jul 15, 2019

 

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

@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.

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!

0 votes
Alexis Robert Community Leader Jul 15, 2019

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

0 votes

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/ 

Suggest an answer

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

Introducing External Collaboration for Confluence

We’re excited to introduce external collaboration for Confluence, now available in early access. It is available to preview for Confluence Cloud Premium and Enterprise customers. (If you're not on ...

197 views 0 7
Read article

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