mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(docker): use a tunable for fastapi proxy host value
On aur-dev.archlinux.org, we use a proxy tunnel through our internal nginx. This allows us to rewrite the Host header based on whatever port we wish within internal nginx config. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
8ae6754766
commit
32b4f75f01
4 changed files with 9 additions and 2 deletions
|
@ -69,6 +69,8 @@ services:
|
||||||
- data:/data
|
- data:/data
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
|
environment:
|
||||||
|
- NGINX_PROXY_PORT=443
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- data:/data
|
- data:/data
|
||||||
|
|
|
@ -244,7 +244,8 @@ services:
|
||||||
image: aurweb:latest
|
image: aurweb:latest
|
||||||
init: true
|
init: true
|
||||||
environment:
|
environment:
|
||||||
- AUR_CONFIG=conf/config
|
# Proxy toward FastAPI.
|
||||||
|
- NGINX_PROXY_PORT=8444
|
||||||
entrypoint: /docker/nginx-entrypoint.sh
|
entrypoint: /docker/nginx-entrypoint.sh
|
||||||
command: /docker/scripts/run-nginx.sh
|
command: /docker/scripts/run-nginx.sh
|
||||||
ports:
|
ports:
|
||||||
|
|
|
@ -136,7 +136,7 @@ http {
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://asgi_backend;
|
proxy_pass http://asgi_backend;
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host HTTP_HOST;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
proxy_set_header X-Forwarded-Ssl on;
|
proxy_set_header X-Forwarded-Ssl on;
|
||||||
|
|
|
@ -21,4 +21,8 @@ fi
|
||||||
|
|
||||||
cp -vf /docker/config/nginx.conf /etc/nginx/nginx.conf
|
cp -vf /docker/config/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
|
||||||
|
# NGINX_PROXY_PORT must be defined for the `nginx` service
|
||||||
|
# within `docker-compose.yml`.
|
||||||
|
sed -i "s|HTTP_HOST|\$host:${NGINX_PROXY_PORT}|g" /etc/nginx/nginx.conf
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
Loading…
Add table
Reference in a new issue