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
|
||||
|
||||
nginx:
|
||||
environment:
|
||||
- AURWEB_FASTAPI_PREFIX=${AURWEB_FASTAPI_PREFIX}
|
||||
restart: always
|
||||
volumes:
|
||||
- data:/data
|
||||
|
|
|
@ -244,7 +244,7 @@ services:
|
|||
image: aurweb:latest
|
||||
init: true
|
||||
environment:
|
||||
- AUR_CONFIG=conf/config
|
||||
- AURWEB_FASTAPI_PREFIX=${AURWEB_FASTAPI_PREFIX}
|
||||
entrypoint: /docker/nginx-entrypoint.sh
|
||||
command: /docker/scripts/run-nginx.sh
|
||||
ports:
|
||||
|
|
|
@ -94,7 +94,9 @@ http {
|
|||
ssl_certificate /etc/ssl/certs/web.cert.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$ {
|
||||
# Override mime type to text/plain.
|
||||
|
|
|
@ -20,5 +20,6 @@ else
|
|||
fi
|
||||
|
||||
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 "$@"
|
||||
|
|
Loading…
Add table
Reference in a new issue