apache-frontend: Allow to use diferent backends for http and https
Use 2 different ports on apache for cached slaves, to differ http and https accesses. Introduce the parameter https-url (with fallback to url) to include specific https urls, if they are different from url. Include /HTTPS/ mapping to traffic server to differ the backends based on the input.
... | @@ -23,6 +23,7 @@ parts = | ... | @@ -23,6 +23,7 @@ parts = |
promise-apache-frontend-v6-https | promise-apache-frontend-v6-https | ||
promise-apache-frontend-v6-http | promise-apache-frontend-v6-http | ||
promise-apache-cached | promise-apache-cached | ||
promise-apache-ssl-cached | |||
trafficserver-launcher | trafficserver-launcher | ||
trafficserver-reload | trafficserver-reload | ||
... | @@ -144,6 +145,7 @@ extra-context = | ... | @@ -144,6 +145,7 @@ extra-context = |
key apache_configuration_directory apache-directory:slave-configuration | key apache_configuration_directory apache-directory:slave-configuration | ||
key apache_cached_configuration_directory apache-directory:slave-with-cache-configuration | key apache_cached_configuration_directory apache-directory:slave-with-cache-configuration | ||
key cached_port apache-configuration:cache-through-port | key cached_port apache-configuration:cache-through-port | ||
key ssl_cached_port apache-configuration:ssl-cache-through-port | |||
key http_port instance-parameter:configuration.plain_http_port | key http_port instance-parameter:configuration.plain_http_port | ||
key https_port instance-parameter:configuration.port | key https_port instance-parameter:configuration.port | ||
key public_ipv4 instance-parameter:configuration.public-ipv4 | key public_ipv4 instance-parameter:configuration.public-ipv4 | ||
... | @@ -225,6 +227,7 @@ extra-context = | ... | @@ -225,6 +227,7 @@ extra-context = |
key instance_home buildout:directory | key instance_home buildout:directory | ||
key ipv4_addr instance-parameter:ipv4-random | key ipv4_addr instance-parameter:ipv4-random | ||
key cached_port apache-configuration:cache-through-port | key cached_port apache-configuration:cache-through-port | ||
key ssl_cached_port apache-configuration:ssl-cache-through-port | |||
key server_admin instance-parameter:configuration.server-admin | key server_admin instance-parameter:configuration.server-admin | ||
key protected_path apache-configuration:protected-path | key protected_path apache-configuration:protected-path | ||
key access_control_string apache-configuration:access-control-string | key access_control_string apache-configuration:access-control-string | ||
... | @@ -284,6 +287,7 @@ cache-pid-file = $${directory:run}/httpd-cached.pid | ... | @@ -284,6 +287,7 @@ cache-pid-file = $${directory:run}/httpd-cached.pid |
# Comunication with ats | # Comunication with ats | ||
cache-port = $${trafficserver-variable:input-port} | cache-port = $${trafficserver-variable:input-port} | ||
cache-through-port = 26011 | cache-through-port = 26011 | ||
ssl-cache-through-port = 26012 | |||
# Create wrapper for "apachectl conftest" in bin | # Create wrapper for "apachectl conftest" in bin | ||
[configtest] | [configtest] | ||
... | @@ -405,7 +409,9 @@ reload-path = $${directory:etc-run}/trafficserver-reload | ... | @@ -405,7 +409,9 @@ reload-path = $${directory:etc-run}/trafficserver-reload |
local-ip = $${instance-parameter:ipv4-random} | local-ip = $${instance-parameter:ipv4-random} | ||
input-port = 23432 | input-port = 23432 | ||
hostname = $${instance-parameter:configuration.frontend-name} | hostname = $${instance-parameter:configuration.frontend-name} | ||
remap = map / http://$${instance-parameter:ipv4-random}:$${apache-configuration:cache-through-port} | remap = map /HTTPS/ http://$${instance-parameter:ipv4-random}:$${apache-configuration:ssl-cache-through-port} | ||
map / http://$${instance-parameter:ipv4-random}:$${apache-configuration:cache-through-port} | |||
|
|||
plugin-config = ${trafficserver:location}/libexec/trafficserver/rfc5861.so | plugin-config = ${trafficserver:location}/libexec/trafficserver/rfc5861.so | ||
cache-path = $${trafficserver-directory:cache-path} | cache-path = $${trafficserver-directory:cache-path} | ||
disk-cache-size = $${instance-parameter:configuration.disk-cache-size} | disk-cache-size = $${instance-parameter:configuration.disk-cache-size} | ||
... | @@ -535,6 +541,12 @@ path = $${directory:promise}/apache_cached | ... | @@ -535,6 +541,12 @@ path = $${directory:promise}/apache_cached |
hostname = $${instance-parameter:ipv4-random} | hostname = $${instance-parameter:ipv4-random} | ||
port = $${apache-configuration:cache-through-port} | port = $${apache-configuration:cache-through-port} | ||
[promise-apache-ssl-cached] | |||
recipe = slapos.cookbook:check_port_listening | |||
path = $${directory:promise}/apache_ssl_cached | |||
hostname = $${instance-parameter:ipv4-random} | |||
port = $${apache-configuration:ssl-cache-through-port} | |||
[slap_connection] | [slap_connection] | ||
# Kept for backward compatiblity | # Kept for backward compatiblity | ||
computer_id = $${slap-connection:computer-id} | computer_id = $${slap-connection:computer-id} | ||
... | ... |