From f6875a5d8043683e051565843c4cf69b9c9bb9ef Mon Sep 17 00:00:00 2001 From: Phong Tran Date: Mon, 18 Nov 2024 12:31:25 -0500 Subject: [PATCH] SVCPLAN-6491: Edit configs for prod --- Dockerfile | 1 - nginx.conf.template | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6e42f32..b24b8b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,6 @@ RUN /usr/local/openresty/luajit/bin/luarocks install lua-resty-session # Copy custom nginx.conf COPY ./nginx.conf.template /usr/local/openresty/nginx/conf/ -#COPY /etc/letsencrypt/live/ /etc/letsencrypt/live/ CMD ["/bin/sh", "-c", "envsubst '${CLIENT_ID} ${CLIENT_SECRET} ${PAT} ${PROXY_FQDN} ${TARGET_FQDN} ${DNS_RESOLVER}' < /usr/local/openresty/nginx/conf/nginx.conf.template > /usr/local/openresty/nginx/conf/nginx.conf && openresty -g 'daemon off;'"] diff --git a/nginx.conf.template b/nginx.conf.template index bc85344..548e845 100644 --- a/nginx.conf.template +++ b/nginx.conf.template @@ -81,7 +81,7 @@ http { sub_filter_types text/html application/json text/plain; # Replaces every occurence of wiki.ncsa.illinois.edu with wiki-p-dev.ncsa.illinois.edu - sub_filter 'https://wiki.ncsa.illinois.edu/' 'https://wiki-p-dev.ncsa.illinois.edu/'; + sub_filter 'https://${TARGET_FQDN}/' 'https://{PROXY_FQDN}/'; # Turn off matching only once sub_filter_once off; @@ -91,7 +91,7 @@ http { proxy_set_header Referer https://${TARGET_FQDN}; proxy_set_header X-Real-IP $remote_addr; #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Authorization "Bearer ${PAT}"; # Your PAT + proxy_set_header Authorization "Bearer ${PAT}"; # Your PAT proxy_pass_header Set-Cookie; proxy_pass https://${TARGET_FQDN}; }