I am having an issues with trying to serve content from a subfolder of my Nginx 1.9.15 install, which is running on MacOS X 10.11. The configuration in my nginx.conf is (there is no other root entry):
location / {
root /Library/WebServer/Documents;
index index.html index.htm;
}
location /media {
root /Library/WebServer/media;
mp4;
mp4_buffer_size 1m;
mp4_max_buffer_size 5m;
}
When I request http://localhost/media/myvideo.mp4, I get in the nginx error.log:
"/Library/WebServer/media/media/myvideo.mp4" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /media/myvideo.mp4 HTTP/1.1", host: "localhost"
I can't quite understand why the 'media' entry is being duplicated. My expectation is that it should be serving /Library/WebServer/media/myvideo.mp4
.
Can anyone suggest what could be wrong?
/Library/WebServer/media/media/myvideo.mp4
rather than/Library/WebServer/media/myvideo.mp4
?