Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redirecting from port 80 to different ports based on URL

I have two applications, (Atlassian JIRA and Confluence,) listening on ports 8080 and 8090, accessible through example.com:8080/jira and example.com:8090/confluence. I would like to set up a redirection on port 80 such that I can access the services through example.com/jira and example.com/confluence.

Is there a simple way to achieve this?

like image 223
Jordane Lew Avatar asked Jan 17 '15 07:01

Jordane Lew


People also ask

How do I redirect my port 80?

Under Hostname Type, select Port 80 Redirect. Enter your current Public IP Address in the IP Address field. Enter the Port number you would like the HTTP requests sent to. Scroll down and click the Add Hostname button when finished to save your configuration.

Can you redirect to any URL?

URL redirect (URL forwarding) allows you to forward your domain visitors to any URL of your choice (to a new domain or a different website). You can set 301 (Permanent), 302 (Unmasked), and Masked (URL Frame) redirects for the domain names pointed to BasicDNS, PremiumDNS or FreeDNS.

How do I redirect a URL to another server?

Method 2: Redirect via HTML Meta tag This is the solution about how to redirect a URL when you have FTP (or similar) access to your site. You just need access to edit the HTML files of the source URL you wish to redirect. Simply edit the specific source HTML file, and add this line to your <head> section.


1 Answers

There are 2 ways of solving this.

Redirect Method

  1. You seem pretty savvy setting up servers. You will need a web Server running on port 80. (Apache: Windows/*nix; IIS: Windows)
  2. Set up a virtual site / folder if you just want example.com/jira and example.com/confluence. You could also do jira.example.com and confluence.example.com if you had your DNS records pointing to the host.
  3. Use a 302 Redirect (temporary/found) to redirect a browser hitting this URL/Virtual Host to the new URL. This method changes the URL in the browser so the browser actually shows the 8080 and 8090 ports.

Proxy Method

The other way, if you wanted transparent URLs would be to set up reverse proxies on the 2 URLs. This way the proxy server on port 80 responds to the client as if the content is originating from port 80. The web server fetches the pages in the background and serves them up. You have the added benefit of caching content using a reverse proxy.

like image 145
Abhi Devireddy Avatar answered Oct 23 '22 03:10

Abhi Devireddy