Skip to content

Commit

Permalink
Hoist variables for proxied hostnames
Browse files Browse the repository at this point in the history
This allows them to be more easily changed locally.
  • Loading branch information
PeterJCLaw committed Feb 15, 2024
1 parent f8fb128 commit c8cb606
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ certbot_create_standalone_stop_services:
# competition. It is required for the competition pages, including the
# competition homepage.
enable_srcomp_proxy: false
srcomp_proxy_hostname: srcomp.studentrobotics.org
# Override serving of the root url to be the competition mode homepage instead
# of the normal one.
enable_competition_homepage: false

# We typically only host the competitor services for the duration of the
# competition year.
enable_competitor_services_proxy: true
competitor_services_proxy_hostname: competitorsvcs.studentrobotics.org

firewall_allowed_tcp_ports:
- "22"
Expand Down
4 changes: 2 additions & 2 deletions roles/srobo-nginx/templates/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ http {
# When the proxied service is not available NGINX will refuse to start.
# Use a variable to trick it into connecting lazily and thus always
# starting up, even if in a degraded mode.
set $competitorsvcs 'competitorsvcs.studentrobotics.org';
set $competitorsvcs '{{ competitor_services_proxy_hostname }}';
proxy_pass https://$competitorsvcs/code-submitter/;
# Note: don't set a Host header as we want the code-submitter to use our
# public hostname, not the hostname of the underlying machine.
Expand All @@ -133,7 +133,7 @@ http {
# When the proxied service is not available NGINX will refuse to start.
# Use a variable to trick it into connecting lazily and thus always
# starting up, even if in a degraded mode.
set $srcomp 'srcomp.studentrobotics.org';
set $srcomp '{{ srcomp_proxy_hostname }}';
proxy_pass https://$srcomp/comp-api/;
}

Expand Down

0 comments on commit c8cb606

Please sign in to comment.