Skip to content

Commit c52abc4

Browse files
committed
ocf_www: proxy apphost vhosts directly from nginx
Have nginx talk to apphost.ocf.berkeley.edu directly instead of going through Apache. Apache no longer needs SSL support so drop apache::mod::ssl and ocf_www::ssl.
1 parent b5c5eb9 commit c52abc4

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

modules/ocf_www/files/vhost-web-nginx.jinja

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ server {
2222
location / {
2323
{% if vhost.is_redirect %}
2424
return {{vhost.redirect_type}} {{vhost.redirect_dest}}$request_uri;
25+
{% elif vhost.is_apphost and vhost.disabled %}
26+
proxy_pass http://127.0.0.1:{{backend_port}};
27+
proxy_set_header Host unavailable.ocf.berkeley.edu;
28+
proxy_set_header X-Forwarded-For $remote_addr;
29+
proxy_set_header X-Forwarded-Proto $scheme;
30+
proxy_set_header X-Real-IP $remote_addr;
31+
{% elif vhost.is_apphost %}
32+
proxy_pass https://apphost.ocf.berkeley.edu;
33+
proxy_set_header Host $host;
34+
proxy_set_header X-Forwarded-For $remote_addr;
35+
proxy_set_header X-Forwarded-Proto $scheme;
36+
proxy_set_header X-Real-IP $remote_addr;
2537
{% else %}
2638
proxy_pass http://127.0.0.1:{{backend_port}};
2739
proxy_set_header Host $host;
@@ -40,7 +52,7 @@ server {
4052
proxy_set_header X-Forwarded-For $remote_addr;
4153
proxy_set_header X-Forwarded-Proto $scheme;
4254
proxy_set_header X-Real-IP $remote_addr;
43-
proxy_pass http://127.0.0.1:{{backend_port}};
55+
proxy_pass https://apphost.ocf.berkeley.edu;
4456
}
4557
{% endfor %}
4658

modules/ocf_www/manifests/init.pp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,8 @@
6969
backport_on => 'stretch';
7070
}
7171

72-
# Apache no longer serves SSL directly (nginx handles it), but mod_ssl is
73-
# still needed for SSLProxyEngine (outbound HTTPS to apphost).
74-
include apache::mod::ssl
75-
7672
include ocf_www::lets_encrypt
7773
include ocf_www::logging
78-
include ocf_www::ssl
7974

8075
# sites
8176
include ocf_www::site::ocfweb_redirects

0 commit comments

Comments
 (0)