| upstream project_settings { | |
| server unix:/app/run/gunicorn.sock | |
| fail_timeout=0; | |
| } | |
| server { | |
| listen 80; | |
| # disable any limits to avoid HTTP 413 for large image uploads | |
| client_max_body_size 0; | |
| location / { | |
| if (!-f $request_filename) { | |
| proxy_pass http://project_settings; | |
| break; | |
| } | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_set_header Host $host; | |
| proxy_redirect off; | |
| } | |
| #static file directory | |
| location /static/ { | |
| alias /home/app/staticfiles/; | |
| } | |
| #media file directory | |
| location /media/ { | |
| alias /app/uploaded_videos/; | |
| } | |
| } | |