挖掘nginx.conf文件
worker_processes 1;
error_log stderr notice;
events {
worker_connections 1024;
}
http {
types_hash_max_size 2048;
upstream cabot_app {
server cabot:5000 max_fails=3 fail_timeout=3s;
}
server {
listen 8088;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://cabot_app;
}
location /static/ {
include /etc/nginx/mime.types;
default_type application/octet-stream;
root /code/;
}
}
}
和docker-compose yaml文件
redis:
image: redis
restart: always
db:
image: postgres
restart: always
ports:
- "5432:5432"
restart: always
environment:
POSTGRES_PASSWORD: test
POSTGRES_USER: test
POSTGRES_DB: tests
cabot:
build: .
restart: always
links:
- redis:celerybroker
- db
- redis
env_file: cabot_env
ports:
- "5000:5000"
nginx:
image: nginx
ports:
- "9999:8088"
links:
- cabot
volumes_from:
- cabot
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./cabot/static/:/code/static:ro
我暂时得到502坏网关。当我重新加载页面时它会消失。
Nginx日志文件给出:
/code/static/CACHE/css/base.36481a0991d5.css“失败(2:没有这样的文件或目录)
答案 0 :(得分:0)
我不熟悉cabot
。但是从错误日志看起来cabot
正在使用django-compressor(不确定)。并且尚未生成CACHE
django-compressor
个文件。
您可能需要添加额外的步骤来生成压缩的css / js文件。
python manage.py compress