fix nginx media serve
This commit is contained in:
parent
4456137954
commit
abd389b04c
@ -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/;
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user