需要配置nginx来反向代理出mongodb的web页面,参考这篇文章 http://serverfault.com/questions/418212/nginx-reverse-proxy-to-mongodb-rest-interface

nginx配置文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
...
location / {

       access_log /var/log/access.log access1;

       proxy_redirect     off;

       proxy_connect_timeout      90;

       proxy_send_timeout         90;

       proxy_read_timeout         90;

       proxy_buffer_size          4k;

       proxy_buffers              432k;

       proxy_busy_buffers_size    64k;

       proxy_temp_file_write_size 64k;

       add_header Cache-Control no-cache;

       proxy_pass http://172.16.30.184:28017;

   }

}
...

不足:只能从根目录进行代理,如需更加完善,需要装编译nginx的时候, –with-http_stub_status_module

然后参考《nginx反代加替换傻瓜教程》进行配置

发表评论