File tree Expand file tree Collapse file tree 4 files changed +15
-19
lines changed
Expand file tree Collapse file tree 4 files changed +15
-19
lines changed Original file line number Diff line number Diff line change @@ -417,14 +417,9 @@ def main():
417417
418418 web_vhosts = get_vhosts ()
419419
420- # Apache config (existing behavior)
420+ # Apache config (web vhosts only; apphost vhosts are proxied
421+ # directly by nginx and don't need Apache backend vhosts)
421422 apache_config = build_config (
422- prod_app_vhosts ,
423- jinja_env .get_template ('vhost-web.jinja' ),
424- dev_config = args .dev ,
425- )
426- apache_config += '\n \n '
427- apache_config += build_config (
428423 web_vhosts ,
429424 jinja_env .get_template ('vhost-web.jinja' ),
430425 dev_config = args .dev ,
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 99 # 301 redirects are more correct, but get cached forever by dumb browsers.
1010 # Doesn't matter too much for vhosts.
1111 RewriteRule ^(.*)$ {{vhost.redirect_dest}}$1 [L,R={{vhost.redirect_type}}]
12- {% elif vhost .is_apphost %}
13- RequestHeader set X-Forwarded-Proto https
14- ProxyPreserveHost On
15- SSLProxyEngine on
16- # Proxy to apphost server
17- ProxyPass / https://apphost.ocf.berkeley.edu/ upgrade=websocket
1812 {% elif vhost .disabled %}
1913 # Proxy to the local "unavailable" vhost, which serves up a friendly
2014 # "your website is rekt" page.
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments