-1

I have an ubuntu machine on hetzner.de where I am hosting all my services including

i. Multisite wordpress (Multiple websites are working here on a single wordpress instance on port 80

ii. Jira instance currently running on a port other then 80 (e.g. 8084)

iii. A tomcat hosting my custom application on a different port and so on.

I need to map a uri such that all these services are accessible through a single port 80. e.g.

assuming my domain is xyz.com pointing to this machine I would like to access all my services such as

xyz.com/wordpress1 xyz.com/wordpress2 xyz.com/tomcat/web1 xyz.com/jira

Any clues how I can achieve this ?

Gautam
  • 99
  • 2
  • As [Sven already answered](https://serverfault.com/a/850388/37681) a reverse proxy, although sometimes you may get better result to establish a reverse proxy on the root of subdomain rather than a subdirectory of your main domain, i.e. reverse proxy `jira.example.com/ --> http://localhost:8084/` instead of `example.com/jira/ --> http://localhost:8084/` – HBruijn May 16 '17 at 11:35

3 Answers3

1

Use Apache or nginx as a reverse proxy.

Sven
  • 97,248
  • 13
  • 177
  • 225
1

Only one software can bind to a specific port at any time.

Nginx (and Apache) can be used a reverse proxy. Not all applications are happy living in a subdirectory, it's something that the developer needs to consider.

If you have dns access you can solve this by using subdomains.

here an exampke with subdomains https://stackoverflow.com/questions/13240840/nginx-reverse-proxy-multiple-backends

here with subdirs, what you asked nginx proxy_pass using subfolder

1

IMO, the easiest way to implement this is with HAProxy using the URI ACL. You can have your backend applications liste to ports other thatn 80 and have HAPROXY listen to 80. Then route the requests based on the URI requests(e.g. site.com/URI), but as stated your application needs to be aware of the URI Path, If it is not aware, then subdomains would be the way to with DOMAIN ACLs.

thinkflux
  • 11
  • 1