server { listen 80; server_name ~^flower.+; root /dev/null; access_log off; error_log /dev/stdout; log_not_found off; location / { proxy_pass http://127.0.0.1:5555; proxy_set_header Host $host; proxy_redirect off; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } server { listen 80 default_server; root /app/web/build; client_max_body_size 20m; location ~ \/\..* { return 404; } location /static/ { alias /app/static/; expires -1; } location /media/ { alias /app/media/; location /media/instagram/results/ { expires 1d; try_files $uri @prod; } try_files $uri @prod; } location @prod { if ($host = "lil.school") { return 404; } proxy_pass https://lil.school; proxy_buffering off; } location / { try_files $uri @django; } location @django { include uwsgi_params; uwsgi_pass 127.0.0.1:9090; } }