location __PATH__ { # Path to source alias __FINALPATH__/ ; if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } include uwsgi_params; # Needed for long running operations in admin interface uwsgi_read_timeout 3600; uwsgi_param SCRIPT_NAME __PATH__; uwsgi_modifier1 30; uwsgi_pass unix:///tmp/__NAME__.socket; }