---
title: "nginx & gridfs   "
author: "masterkey"
date: "2011-09-21T13:28:22Z"
tags: []
categories: ["互联网"]
slug: "nginx-gridfs"
draft: false
lastmod: "2011-09-21T13:28:22Z"
id: 1176981
url: "https://masterkey.iteye.com/blog/1176981"
---

location /pics/ {

            gridfs gridfs   field=filename     type=string;  
            mongo 192.168.51.103:27002;  
        }

        location /pic/ {  
           proxy\_set\_header Host  $host;  
           proxy\_set\_header X-Forwarded-For  $remote\_addr;  
           proxy\_buffer\_size 16k;  
           proxy\_buffers 4 64k;  
           proxy\_pass http://mongo/pics/;  
            proxy\_set\_header       Host $host;  
            proxy\_cache            STATIC;  
            proxy\_cache\_valid      200  1d;  
            proxy\_cache\_use\_stale  error timeout invalid\_header updating    http\_500 http\_502 http\_503 http\_504;  
        }