Skip to content

Commit

Permalink
Merge branch 'local_https_fix' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
kaliif committed Dec 6, 2023
2 parents 099ef49 + f9220fb commit d1055c8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ COPY django_nginx.conf /etc/nginx/sites-available/default.conf
COPY proxy_params /etc/nginx/frag_proxy_params
COPY requirements.txt ./


RUN ln -s /etc/nginx/sites-available/default.conf /etc/nginx/sites-enabled && \
pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir --requirement requirements.txt
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ services:
SQUONK2_UI_URL: ${SQUONK2_UI_URL}
SQUONK2_DMAPI_URL: ${SQUONK2_DMAPI_URL}
SQUONK2_ASAPI_URL: ${SQUONK2_ASAPI_URL}
PROXY_FORWARDED_PROTO_HEADER: ${PROXY_FORWARDED_PROTO_HEADER:-http}
ports:
- "8080:80"
depends_on:
Expand Down
9 changes: 9 additions & 0 deletions launch-stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ gunicorn fragalysis.wsgi:application \
--log-file=/srv/logs/gunicorn.log \
--access-logfile=/srv/logs/access.log

# added as a fix to #1215, mixing http and https requests to enable
# local development with http. Need to set the env variable in compose
# file or .env.

# NB! this is probably a workaround for some other issue we haven't
# discovered yet. It suddenly broke but right now seems to work in
# firefox. Hopefully won't be necessary soon
echo proxy_set_header X-Forwarded-Proto "${PROXY_FORWARDED_PROTO_HEADER:-https};" >> /etc/nginx/frag_proxy_params

echo "Testing nginx config..."
nginx -tq

Expand Down
2 changes: 1 addition & 1 deletion proxy_params
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
# proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 120s;
proxy_send_timeout 120s;
proxy_connect_timeout 120s;

0 comments on commit d1055c8

Please sign in to comment.