Open thomasbachem opened 11 years ago
I can confirm that the progress does not work when SPDY is enabled. Please fix it, we would like to enable SPDY!
Well to my knowledge (didn't try it), the problem is that OPTIONS is not supported by Nginx (nor this plugin). But I believe this can be worked-around with something like that:
location /progress {
...
if ($request_method = OPTIONS ) {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods "GET, OPTIONS";
add_header Access-Control-Allow-Headers "origin, authorization, accept";
add_header Access-Control-Allow-Credentials "true";
add_header Content-Length 0;
add_header Content-Type text/plain;
return 200;
}
...
}
If that's working, please let me know.
I'll see how I can fix this issue in the plugin itself.
Can someone confirm the above work-around works?
Can someone confirm the above work-around works?
@masterzen No unfortunately it does not..
I tried this workaround a few month ago, and it was not working...
@masterzen fyi: this is working for us:
# upload progress
location ^~ /progress {
if ($request_method = OPTIONS ) {
add_header Access-Control-Allow-Origin allowed-host.example.com;
add_header Access-Control-Allow-Methods "GET, OPTIONS";
add_header Access-Control-Allow-Headers "origin, authorization, accept, X-Progress-ID";
add_header Access-Control-Allow-Credentials "true";
add_header Content-Length 0;
add_header Content-Type text/plain;
return 204;
}
add_header Access-Control-Allow-Origin allowed-host.example.com;
add_header 'Access-Control-Allow-Credentials' 'true';
upload_progress_json_output;
report_uploads proxied;
}
@pulse00 TY for this snippet, this solved problems in the Nginx + Symfony 4.1.x CORS context for me.
I used this snippet inside a specific Nginx location to avoid 405 method not allowed for CORS preflight requests
if ($request_method = OPTIONS ) {
add_header Access-Control-Allow-Origin "https://mydomain.ext";
return 200;
}
When enabled SPDY support in nginx, Chrome sends an OPTIONS request to e.g. /progress first, before requesting it via GET.
This results in a 405 Method Not Allowed response right now:
Instead, something like the following response should be returned by the upload progress module:
Possibly somehow related to http://forum.nginx.org/read.php?29,236251,236251.