server {
    listen 80;
    server_name localhost;
    server_tokens off;
    access_log  /var/log/nginx/example.log;

    location /static/ {
        autoindex off;
        alias /static_files/;
    }

    location /media/ {
        autoindex off;
        alias /media/;
    }

    location / {
        try_files $uri $uri/ @villafleurie;
    }

    location @villafleurie {
        proxy_pass http://web:8000;
        proxy_pass_request_headers on;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_redirect off;
    }
} 