Two standalone web apps with same DNS

Hi,

I have two web apps on a server

how can I redirect from a link into a webpage
to a specific web app without declare the port into the link?

There is a way to redirect to the right door (to the right app)
without indicate the door in the link?

Thank you

You’ll need a reverse proxy or a load balancer to do that.

Hello Greg,

but in case of a reverse proxy or firewall with same feature,
how can I tell it what app must to switch when a link point to IP of proxy/firewall?

Thank You

You still need some kind of criteria to tell between right or wrong. You can send US IP-addresses to web app 1 and EU addresses to webapp 2, for instance.

How would the webapp know about your business rules? Okay, if Steve Jobs still was with us, we already would have clearvoyant computers, but alas …

Hello Oliver,

sorry but I do not know well the mechanism…
What is EU addresses?

Ciao Marco, penso che Oliver intenda dire che come esempio si possa inserire una regola le firewall che riconosca gli indirizzi ip di connessioni che arrivano dagli stati uniti (US) sulla porta 80 http e dirotti il traffico sulla porta del server interno (ad esempio 8080) e poi riconosca gli indirizzi europei (EU) per dirottarli sull’altra porta (8081).
In pratica tu devi preparare le due applicazioni standalone per rispondere su queste due porte e poi preparare adeguatamente il firewall per dirottare su di esse il traffico.
Non so come riconoscere la posizione geografica degli indirizzi IP, ma probabilmente cercando su internet si trova qualche documento che potrebbe aiutare.
Ma non so se questo quello che ti serve.

Ciao Marco,

più che dirottare il traffico proveniente da zone diverse
quello che mi serve è avere sulla stesso indirizzo IP (e sulla stessa macchina) più applicazioni funzionanti,
ma non so come fare per dirottare per esempio pippo.cucu.it su webapp1 porta 1080 e titty.cucu.it su webapp2 porta 1088

Grazie

I see various way to achieve such redirect on your server. (Search this forum for redirect)

One way I do it requires php enabled. I replaced the index.html default file with a index.php file and this could look as follows:

[code]<?php
$myurl=$_SERVER[‘HTTP_HOST’];

switch ($myurl)
{
case “pippo.cucu.it”:
header(“Location: http://cucu.it:1080”);
break;
case “titty.cucu.it”:
header(“Location: http://cucu.it:1088”);
break;
default:
// echo $_SERVER[“HTTP_REFERER”];
header(“Location: http://www.cucu.it/”);
}
?>[/code]

On the Xojocloud I placed the the below file named index.html in the web folder on my server. If the subdomain of one is app1 then it routes to the app in the app1 folder and if it is any other subdomain it goes to app2 This also reroutes http requests to https.

[code]

[/code]

ok, ThankYou Oliver, I tray later this solution.
Thank You Stephen …