Confluence - dynamic external link

Hi,

we are using a self-hosted instance of Confluence which is accessible through a local IP address as well as a semi-public IP address. On the same server with the confluence instance we have another website hosted. The setup looks something like this:

Confluence:

  • local address / host: confluence.idi.local
  • local IP access: 172.16.1.6:8060
  • external IP access: 3.215.106.6:8060

Wiki:

  • local address / host: wiki.idi.local
  • local IP access: 172.16.1.6/wiki
  • external IP access: 3.215.106.6/wiki

My issue is the following: I need to find a way to display an image that is hosted on the Wiki site in Confluence when the page containing the link to the image is displayed from the local network but also from the external one.

Also, I can not access the local IP from the external network nor the external IP from the local network.

Is there any way to achieve this?

Thanks!

3 answers

1 vote

Hi Mircea, 

What do you want to do can be done using rewrite mode. I don't now if you are using apache or another webserver. However, you can looking for the rewrite flag on google. Nowadays, almost all  web server and load balancers support it.

Bellow you can see an example using apache:

Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:

Options +FollowSymLinks -MultiViews

# Turn mod_rewrite on

RewriteEngine On

RewriteBase /folder_path/where_is_the_image/

RewriteRule ^my_image\.png$

Make sure:

  • .htaccess is enabled
  • mod_rewrite is enabled

In the link below you can find more details about mod_rewrite flags.

http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

 

I hope it helps.

 

Best regards, 

Renato Rudnicki

Atlassian Support

Hello Mircea,

 

I was having a hard time understanding what you are attempting to accomplish with this comment. Could you please rephrase it?

 

My issue is the following: I need to find a way to display an image that is hosted on the Wiki site in Confluence when the page containing the link to the image is displayed from the local network but also from the external one.

 

Regarding not being able to access Confluence via internal IP over an external network. Every internal network generally has the same subnet configuration. The way you would reach that Confluence instance would be through the external IP and port number Confluence uses. Keep in mind you will need to make a Firewall NAT configuration to push that traffic to the correct Confluence server.

 

Another method is to VPN into the private network then access the Confluence server that way.

 

-Regards,
Tin Nguyen | Confluence Support.

Hi Tin,

let me explain this again. Let's say I have an image which is located at the following path:

wiki.idi.local/images/my_image.png

OR

172.16.1.6/wiki/images/my_image.png

I can link to this image in Confluence while using the above path and the image will be displayed correctly while I am accessing confluence from my local network (by using confluence.idi.local or 172.16.1.6:8060).

As soon as I access confluence from the external network (by using 3.215.106.6:8060) the path to this image can not be resolved anymore. In order to find this image from the external network I would need to use the following link:

3.215.106.6/wiki/images/my_image.png

If I use this link instead, I can not view the image from my internal network.

Is this a bit clearer?

What I wanted to know is if there is a way to have this image's link "translated" depending on the location where I access it from.

Thanks,

Mircea

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

982 views 23 13
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