问题
I am wanting to setup an AWS Elastic Load Balancer in front of a Phabricator installation. I would like the ELB to balance HTTP, HTTPS and SSH traffic. Is this possible or do I need to run my own SSH load balancer with HAProxy or similar?
To clarify, I am aiming to load balance git operations which occur over SSH, as distinct from administrative SSH.
回答1:
In my case of Phabricator + AWS ELB setup
Allowed ELB port for phab instances.
Configured VirtualHost redirection from HTTP to HTTPS in apache sites-enable configuration file. First rules all HTTPS connection forwarded to "https://phab.example.com/index.php?path=$1" and the second rule is catching HTTP connection and redirects to HTTPS.
<VirtualHost *:80> : ... RewriteEngine On RewriteCond %{HTTP:X-Forwarded-Proto} =https RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA] RewriteCond %{HTTP:X-Forwarded-Proto} =http RewriteRule . https://%{HTTP:Host}%{REQUEST_URI} [L,R=permanent] ... : </VirtualHost>
- Change Phabricator base url to HTTPS with port(443) in phab configuration (local.json)
I hope this will Help you
来源:https://stackoverflow.com/questions/33363041/using-an-elastic-load-balancer-for-ssh-traffic