mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(docker): rewrite trailing slashes with AURWEB_FASTAPI_PREFIX
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
377bf32cfb
commit
29b86dd15a
4 changed files with 7 additions and 2 deletions
|
@ -69,6 +69,8 @@ services:
|
||||||
- data:/data
|
- data:/data
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
|
environment:
|
||||||
|
- AURWEB_FASTAPI_PREFIX=${AURWEB_FASTAPI_PREFIX}
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- data:/data
|
- data:/data
|
||||||
|
|
|
@ -244,7 +244,7 @@ services:
|
||||||
image: aurweb:latest
|
image: aurweb:latest
|
||||||
init: true
|
init: true
|
||||||
environment:
|
environment:
|
||||||
- AUR_CONFIG=conf/config
|
- AURWEB_FASTAPI_PREFIX=${AURWEB_FASTAPI_PREFIX}
|
||||||
entrypoint: /docker/nginx-entrypoint.sh
|
entrypoint: /docker/nginx-entrypoint.sh
|
||||||
command: /docker/scripts/run-nginx.sh
|
command: /docker/scripts/run-nginx.sh
|
||||||
ports:
|
ports:
|
||||||
|
|
|
@ -94,7 +94,9 @@ http {
|
||||||
ssl_certificate /etc/ssl/certs/web.cert.pem;
|
ssl_certificate /etc/ssl/certs/web.cert.pem;
|
||||||
ssl_certificate_key /etc/ssl/private/web.key.pem;
|
ssl_certificate_key /etc/ssl/private/web.key.pem;
|
||||||
|
|
||||||
rewrite ^/(.*)/$ /$1 permanent;
|
# Rewrite trailing slashes; AURWEB_FASTAPI_PREFIX should
|
||||||
|
# be replaced with the desired FastAPI base url.
|
||||||
|
rewrite ^/(.*)/$ AURWEB_FASTAPI_PREFIX/$1 permanent;
|
||||||
|
|
||||||
location ~ ^/[^\/]+\.gz$ {
|
location ~ ^/[^\/]+\.gz$ {
|
||||||
# Override mime type to text/plain.
|
# Override mime type to text/plain.
|
||||||
|
|
|
@ -20,5 +20,6 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp -vf /docker/config/nginx.conf /etc/nginx/nginx.conf
|
cp -vf /docker/config/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
sed -i "s|AURWEB_FASTAPI_PREFIX|${AURWEB_FASTAPI_PREFIX}|g" /etc/nginx/nginx.conf
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
Loading…
Add table
Reference in a new issue