简体   繁体   中英

In linux Ubuntu, using apache2, I need to host multiple websites in single domain, but use ssl port

I am running 3 web servers in single linux ubuntu server.

A) Glassfish web server (non-ssl and ssl)

1) http: //saravan-spring.com:9090/
2) https: //saravan-spring.com:9443

both pointing to the same source path

B) Tomcat web server (non-ssl and ssl)

1) http: //saravan-spring.com:7070/
2) https: //saravan-spring.com:8443

both pointing to the same source path

C) Apache2 web server : It should be the entry point to receive from both ports 80 and 443

I need to call appropriate URIS as below

http: //saravan-spring.com => http: //saravan-spring.com:9090/

https: //saravan-spring.com => https: //saravan-spring.com:9443/

http: //web.saravan-spring.com => http: //saravan-spring.com:7070/

https: //web.saravan-spring.com => https: //saravan-spring.com:8443/

How do I configure in apache2?

One more condition. my internal ports 9090, 9443, 7070, 8443 need to be invisible to the end users. it should not be exposed to the outside world.

If not possible, I am ready to eliminate non-ssl completely. And I am ready to run ssl ports only. I mean I ready to live with A (2) and B (2) only.

I'm used nginx as frontend. Configuration example:

server {
listen *:80; ## listen for ipv4
server_name MYDOMAIN.COM;
access_log /var/log/nginx/access.log;

# backend list. may be lot of them
location / {
proxy_pass MY_IP_OR_DOMAIN:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_connect_timeout 120;
proxy_send_timeout 120;
proxy_read_timeout 180;
}
}

To use ssl add to certificate section(read docs)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM