diff --git a/deployment/scripts/nginx/nginx.conf b/deployment/scripts/nginx/nginx.conf index 5094982..19f9d17 100644 --- a/deployment/scripts/nginx/nginx.conf +++ b/deployment/scripts/nginx/nginx.conf @@ -6,11 +6,13 @@ http { server { listen 80; - location /static/ { + location /static { + autoindex on; alias /usr/src/app/static/; } - location /media/ { + location /media { + autoindex on; alias /usr/src/app/media/; } } diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 81e0717..82c2ec2 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -76,12 +76,9 @@ services: - media_files:/usr/src/app/media labels: - "traefik.enable=true" - - "traefik.http.routers.${APP_NAME}-nginx-static.rule=Host(`${APP_HOST}`) && PathPrefix(`/static`)" - - "traefik.http.routers.${APP_NAME}-nginx-media.rule=Host(`${APP_HOST}`) && PathPrefix(`/media`)" - - "traefik.http.routers.${APP_NAME}-nginx-static.entrypoints=web" - - "traefik.http.routers.${APP_NAME}-nginx-media.entrypoints=web" - - "traefik.http.services.${APP_NAME}-nginx-static.loadbalancer.server.port=80" - - "traefik.http.services.${APP_NAME}-nginx-media.loadbalancer.server.port=80" + - "traefik.http.routers.${APP_NAME}-nginx.rule=Host(`${APP_HOST}`) && (PathPrefix(`/static`) || PathPrefix(`/media`))" + - "traefik.http.routers.${APP_NAME}-nginx.entrypoints=web" + - "traefik.http.services.${APP_NAME}-nginx.loadbalancer.server.port=80" depends_on: - backend