Skip to content

Commit

Permalink
add ENKETO_URL and SERVICE_URL
Browse files Browse the repository at this point in the history
Co-authored-by: Tobias McNulty <tobiasmcnulty@users.noreply.github.com>
  • Loading branch information
copelco and tobiasmcnulty committed Jan 9, 2024
1 parent 9f54d62 commit 90d2b5d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ services:
- enketo
environment:
- DOMAIN=${DOMAIN}
- ENKETO_URL=${ENKETO_URL:-http://enketo:8005}
- SERVICE_URL=${SERVICE_URL:-http://service:8383}
- CERTBOT_EMAIL=${SYSADMIN_EMAIL}
- SSL_TYPE=${SSL_TYPE:-letsencrypt}
- SENTRY_ORG_SUBDOMAIN=${SENTRY_ORG_SUBDOMAIN:-o130137}
Expand Down
4 changes: 2 additions & 2 deletions files/nginx/odk.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ server {
gzip_types text/plain text/css application/json application/x-javascript text/xml text/csv;

location /- {
proxy_pass http://enketo:8005;
proxy_pass ${ENKETO_URL};
proxy_redirect off;
proxy_set_header Host $host;

Expand All @@ -46,7 +46,7 @@ server {

location ~ ^/v\d {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://service:8383;
proxy_pass ${SERVICE_URL};
proxy_redirect off;

# buffer requests, but not responses, so streaming out works.
Expand Down
2 changes: 1 addition & 1 deletion files/nginx/setup-odk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fi
echo "writing fresh nginx templates..."
cp /usr/share/odk/nginx/redirector.conf /etc/nginx/conf.d/redirector.conf
CNAME=$( [ "$SSL_TYPE" = "customssl" ] && echo "local" || echo "$DOMAIN") \
envsubst '$SSL_TYPE $CNAME $SENTRY_ORG_SUBDOMAIN $SENTRY_KEY $SENTRY_PROJECT' \
envsubst '$SSL_TYPE $CNAME $SENTRY_ORG_SUBDOMAIN $SENTRY_KEY $SENTRY_PROJECT $ENKETO_URL $SERVICE_URL' \
< /usr/share/odk/nginx/odk.conf.template \
> /etc/nginx/conf.d/odk.conf

Expand Down

0 comments on commit 90d2b5d

Please sign in to comment.