I have a domain name domainname.com
using centos7.
I have subdomains where differents applications run. For example:
https://app1.domainname.com
https://app2.domainname.com
https://app3.domainname.com
https://nginx.domainname.com
app1, app2, app3 and nginx are four differents servers.
app1, app2 and app3 are accessible from the internet.
What I want is to access all my applications from the internet via https://nginx.domainname.com
. For example:
https://nginx.domainname.com/app1
→ to serve https://app1.domainname.com
https://nginx.domainname.com/app2
→ to serve https://app2.domainname.com
https://nginx.domainname.com/app3
→ to serve https://app3.domainname.com
To achieve that, I have configured the reverse proxy in the https://nginx.domainname.com
server to access app1 app2 app3 via the https://nginx.domainname.com
server.
I modified the nginx.conf file of the https://nginx.domainname.com
server as follows:
…
http
{
…
server
{
…
serveur_namenginx.domainname.com
…
location /app1{
proxy_set_header host $proxy_host;
proxy_passapp1.domainname.com
; }
location /app2{
proxy_set_header host $proxy_host;
proxy_passapp2.domainname.com
; }
location /app3{
proxy_set_header host $proxy_host;
proxy_passapp3.domainname.com
; }
}
}
but I can’t access apps through the https://nginx.domainname.com
server
I cannot find a Way to achieve this after many try… I get error like server https://nginx.domainname.com
is not accessible
Can you help me with the different steps to follow to achieve this?