upstream sanity_server {
    server unix:/tmp/sanity.sock fail_timeout=0;
    # For a TCP configuration:
    # server 192.168.0.7:8000 fail_timeout=0;
}

server {
	listen 80 default;
	client_max_body_size 4G;
	server_name _;

	keepalive_timeout 5;

	# path for static files
	root /var/flask/sanity/sanity/static;

	location / {
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header Host $http_host;
		proxy_redirect off;

		if (!-f $request_filename) {
			proxy_pass http://sanity_server;
			break;
		}
	}
}
