fix nginx media serve
This commit is contained in:
parent
459fe09307
commit
32276412fc
@ -8,9 +8,14 @@ http {
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
location ~ ^/(images|javascript|js|css|flash|media|static)/ {
|
||||
location /static {
|
||||
autoindex on;
|
||||
alias /usr/src/app/;
|
||||
alias /usr/src/app/static/;
|
||||
}
|
||||
|
||||
location /media {
|
||||
autoindex on;
|
||||
alias /usr/src/app/media/;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ services:
|
||||
- media_files:/usr/src/app/media
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.${APP_NAME}-nginx.rule=Host(`${APP_HOST}`) && (PathPrefix(`/static`) && PathPrefix(`/media`))"
|
||||
- "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:
|
||||
@ -90,6 +90,9 @@ services:
|
||||
- "--providers.docker.exposedbydefault=false"
|
||||
- "--entrypoints.web.address=:80"
|
||||
- "--entrypoints.web-secure.address=:443"
|
||||
- "--log.level=DEBUG"
|
||||
- "--log.format=json"
|
||||
- "--log.filePath=/logs/traefik.log"
|
||||
- "--accesslog=true"
|
||||
- "--accesslog.filePath=/logs/access.log"
|
||||
- "--certificatesresolvers.letsencrypt.acme.email=${LETSENCRYPT_EMAIL}"
|
||||
|
Loading…
Reference in New Issue
Block a user