Answer the question
In order to leave comments, you need to log in
Nginx does not serve content to some browsers
There is a server, apache and nginx are installed on it as a front-end. Those. gives the static itself, the rest passes to the Apache.
Recently there was a move from one server to another, I just copied the configs and everything seemed to work, but users began to complain that the files were not downloading.
Indeed, when I opened Google Chrome and tried to download the file, I only saw the response headers
AND the status "(canceled)" (in the Network tab in dev-tools).
The file is not downloading.
Opened FireFox and downloaded the file.
The headers are as follows:
The file has successfully started downloading.
By the way - I give the file through php simply through header('Location: ...');
Location in nginx is:
Empty in error.log. Please help me solve the problem.
Request URL:http://....mp4
Request Method:GET
Status Code:206 Partial Content
Response Headers
Cache-Control:max-age=86400
Connection:keep-alive
Content-Length:1
Content-Range:bytes 4021-4021/87723281
Content-Type:application/octet-stream
Date:Tue, 01 Nov 2011 13:14:22 GMT
Expires:Wed, 02 Nov 2011 13:14:22 GMT
Last-Modified:Sun, 30 Oct 2011 22:33:24 GMT
Server:nginx
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 01 Nov 2011 13:17:34 GMT
Content-Type: application/octet-stream
Content-Length: 87723281
Last-Modified: Sun, 30 Oct 2011 22:33:24 GMT
Connection: keep-alive
Expires: Wed, 02 Nov 2011 13:17:34 GMT
Cache-Control: max-age=86400
Accept-Ranges: bytes
location ~* ^.+\.(mp4)$ {
proxy_temp_path /home/proxy/ 1 2;
root /static/$host;
ssi on;
error_log /var/log/nginx/static.error.log;
expires 24h;
}
Answer the question
In order to leave comments, you need to log in
Checked - the same problem as in Chrome is observed in Safari.
The following entry appears in the browser log:
Chrome: Resource interpreted as Other but transferred with MIME type undefined.
Safari: Resource interpreted as Document but moved with MIME type application/octet-stream.
As an option - try to give mp4 files with MIMI video / mp4, maybe something will come of it. Also look at what version of nginx, maybe an update will help.
And things still haven't been able to solve the problem yet
location /files {
if ($request_filename ~* ^.*?/([^/]*?)$)
{
set $filename $1;
add_header Content-Disposition "attachment; filename=$filename";
}
}
doesn't work for some reason
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question