Fix user-media loading in local environments (#22732)
* Fix user-media loading in local environments URLs with /user-media/foo should map to <root_storage>/user-media/shared_storage/uploads/ on the filesystem.
This commit is contained in:
Родитель
efedc6e628
Коммит
bc34e66cfa
|
@ -67,7 +67,7 @@ jobs:
|
|||
run: make lint-codestyle
|
||||
-
|
||||
name: Manage Check
|
||||
services: web
|
||||
services: web nginx
|
||||
compose_file: docker-compose.yml:docker-compose.ci.yml
|
||||
run: make check
|
||||
steps:
|
||||
|
|
|
@ -46,8 +46,13 @@ check_django: ## check if the django app is configured properly
|
|||
DJANGO_SETTINGS_MODULE='settings_local' python3 ./manage.py check
|
||||
rm settings_local.py
|
||||
|
||||
.PHONY: check_nginx
|
||||
check_nginx: ## check if the nginx config for local development is configured properly
|
||||
@if [ "$$(curl -sf http://nginx/user-media/.check)" != "OK" ]; then echo "Requesting http://nginx/user-media/.check failed"; exit 1; fi
|
||||
@echo "Nginx user-media configuration looks correct."
|
||||
|
||||
.PHONY: check
|
||||
check: check_files check_olympia_user check_debian_packages check_pip_packages check_django
|
||||
check: check_nginx check_files check_olympia_user check_debian_packages check_pip_packages check_django
|
||||
|
||||
.PHONY: data_dump
|
||||
data_dump:
|
||||
|
|
|
@ -20,7 +20,7 @@ server {
|
|||
}
|
||||
|
||||
location /user-media/ {
|
||||
alias /srv/user-media/;
|
||||
alias /srv/user-media/shared_storage/uploads/;
|
||||
}
|
||||
|
||||
location ~ ^/api/ {
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
OK
|
Загрузка…
Ссылка в новой задаче