upstream gunicorn {
    server web:80;
}

server {
    listen 80;
    server_name tagesschule.mprofiag.ch;
    server_tokens off;
    sendfile on;

    add_header X-Frame-Options "";

    client_max_body_size 1000M;

    gzip on;
    gzip_http_version 1.1;
    gzip_disable      "MSIE [1-6]\.";
    gzip_min_length   256;
    gzip_vary         on;
    gzip_proxied      expired no-cache no-store private auth;
    gzip_types        text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
    gzip_comp_level   9;

    location /static/ {
        sendfile on;
        alias /app/static_collected/;
    }

    location /media/ {
        sendfile on;
        alias /app/data/media/;
    }

    location / {
        proxy_hide_header X-Frame-Options;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $host;
        proxy_redirect off;
        proxy_pass http://gunicorn;
    }
}

