nginx-gridfs icon indicating copy to clipboard operation
nginx-gridfs copied to clipboard

Not work

Open Alsmile opened this issue 10 years ago • 4 comments

GET http://127.0.0.1/images/5397f74005fbed25453660a3 net::ERR_EMPTY_RESPONSE

user nobody;

worker_processes 1;

error_log logs/error.log;

error_log logs/error.log notice;

error_log logs/error.log info;

pid logs/nginx.pid;

worker_rlimit_nofile 51200;

events { use epoll; worker_connections 51200; }

http { include mime.types; default_type application/octet-stream;

#access_log  logs/access.log  main;

sendfile        on;
#tcp_nopush     on;

keepalive_timeout  65;

gzip on;
gzip_min_length 1100; 
gzip_buffers 4 8k; 
gzip_types text/plain application/x-javascript text/css;
output_buffers 1 32k;
postpone_output 1460;
client_max_body_size 20m;

upstream node_server_asievue {
    server 127.0.0.1:3000 max_fails=1;   
}

map $http_upgrade $connection_upgrade {
    default upgrade;
    ''    close;
}

server {
    listen       80;
    server_name  localhost;

    tcp_nodelay on;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;

    location / {            
        proxy_pass http://node_server_asievue;
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;

        client_max_body_size 10m;
        client_body_buffer_size 128k;
        proxy_connect_timeout 90;
        proxy_send_timeout 90;
        proxy_read_timeout 90;
        proxy_buffer_size 4k;
        proxy_buffers 4 32k;
        proxy_busy_buffers_size 64k;
        proxy_temp_file_write_size 64k;
     }

      location /images/ { 
         gridfs asievue root_collection=image field=_id type=objectid user=asievue pass=asve^dkg646dfs45;
         mongo 127.0.0.1:27017;
     }

}

}

error.log

2014/06/11 15:42:34 [error] 22179#0: *7 Mongo connection dropped, could not reconnect, client: 127.0.0.1, server: localhost, request: "GET /images/5397f74005fbed25453660a3 HTTP/1.1", host: "127.0.0.1" 2014/06/11 15:42:34 [alert] 22179#0: *7 header already sent, client: 127.0.0.1, server: localhost, request: "GET /images/5397f74005fbed25453660a3 HTTP/1.1", host: "127.0.0.1"

Alsmile avatar Jun 11 '14 07:06 Alsmile

Same issue here. The connection works in a way because it correctly detects if there is a file or not (404), but when there is, this message appears, leading to a "no data received" issue

pbriet avatar Jun 27 '14 16:06 pbriet

+1,How fix it?

myfreax avatar Jul 31 '17 09:07 myfreax

3 years later : no idea. I finally dropped GridFS, whick lack support. I encourage you to do the same and look for alternatives.

pbriet avatar Jul 31 '17 09:07 pbriet

thank you,I originally wanted to use mongodb's GridFS as an object store. But I just found a good solution The Project minio

myfreax avatar Jul 31 '17 09:07 myfreax