fix nginx media serve
This commit is contained in:
parent
41cfada8f1
commit
459fe09307
@ -3,17 +3,14 @@ events {}
|
|||||||
http {
|
http {
|
||||||
include /etc/nginx/mime.types;
|
include /etc/nginx/mime.types;
|
||||||
default_type application/octet-stream;
|
default_type application/octet-stream;
|
||||||
|
access_log /var/log/nginx/access.log;
|
||||||
|
error_log /var/log/nginx/error.log;
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
location /static {
|
location ~ ^/(images|javascript|js|css|flash|media|static)/ {
|
||||||
autoindex on;
|
autoindex on;
|
||||||
alias /usr/src/app/static/;
|
alias /usr/src/app/;
|
||||||
}
|
|
||||||
|
|
||||||
location /media {
|
|
||||||
autoindex on;
|
|
||||||
alias /usr/src/app/media/;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ services:
|
|||||||
- media_files:/usr/src/app/media
|
- media_files:/usr/src/app/media
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "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.routers.${APP_NAME}-nginx.entrypoints=web"
|
||||||
- "traefik.http.services.${APP_NAME}-nginx.loadbalancer.server.port=80"
|
- "traefik.http.services.${APP_NAME}-nginx.loadbalancer.server.port=80"
|
||||||
depends_on:
|
depends_on:
|
||||||
|
Loading…
Reference in New Issue
Block a user