原文地址:http://www.grid.net.ru/nginx/mogilefs.en.html (在墙外)
Nginx mogilefs module (v 1.0.3)
|
rus eng |
MogileFS client for nginx web server.
Description
The module queries MogileFS tracker specified by mogilefs_tracker directive and uses first path returned by tracker to fetch requested file. The file key is specified by mogilefs_pass directive. If no domain or no file with specified key is found by tracker "404 Not found" status is retuned. If file is found but zero paths are returned by tracker "503 Service unavailable" status is retuned. If tracker has returned successful response the modules tries to fetch file using path with the greatest priority.
Configuration directives
syntax: mogilefs_pass [<key>] {<fetch block>}
default: none
severity: mandatory
context: server, location, limit_except
Specifies key of the file to query from MogileFS tracker. The key can contain any variables. If key is omitted, the part of request URI will be uses as key, which remains after stripping the name of mathced location.
location /download/ {
mogilefs_pass {
[...]
}
}
In this example if request URI is /download/example.jpg, the tracker will be queried for file with the key example.jpg.
The fetch block contains configuration which will be used to fetch file from storage node. In this block it is necessary to use proxy_pass directive with $mogilefs_path as an argument. Example:
mogilefs_pass {
proxy_pass $mogilefs_path;
proxy_hide_header Content-Type;
proxy_buffering off;
}
The variable $mogilefs_path contains absolute URL to the file on storage node. The fetch block creates a hidden internal location with the name /mogilefs_fetch_XXXXXXXX, where redirected will be performed after successful tracker response.
syntax: mogilefs_methods <[[method 1] method 2 ... ]>
default: GET
severity: optional
context: main, server, location
Specifies which methods will be allowed to access MogileFS. GET retrieves a resource from MogileFS, PUT creates or replaces, DELETE deletes a resource in MogileFS.
syntax: mogilefs_domain <domain>
default: default
severity: optional
context: main, server, location
Specifies the name of MogileFS domain to query. The specification may contain variables.
syntax: mogilefs_class <class0> [ <class1> [ ... ] ]
default: N/A
severity: optional
context: main, server, location
This directive specifies what to use as "class" parameter when making a request to tracker. The arguments of this directives will be evaluated and first non-empty value will be used as class. Arguments can contain variables.
syntax: mogilefs_tracker <IP|IP:port|upstream>
default: none
severity: mandatory
context: main, server, location
Specifies address of MogileFS tracker to query.
syntax: mogilefs_noverify <on/off>
default: off
severity: optional
context: main, server, location
Enables sending of noverify argument to MogileFS.
syntax: mogilefs_connect_timeout <time>
default: 60s
severity: optional
context: main, server, location
Specifies a timeout to be used to connect to mogilefs tracker. Could not be longer than 75 seconds.
syntax: mogilefs_send_timeout <time>
default: 60s
severity: optional
context: main, server, location
Specifies a timeout to be used to send data to mogilefs tracker. If no data will be received by mogilefs tracker during this time interval, nginx will close the connection.
syntax: mogilefs_read_timeout <time>
default: 60s
severity: optional
context: main, server, location
Specifies a timeout to be used to receive data from mogilefs tracker. If no data will be send by mogilefs tracker during this time interval, nginx will close the connection.
Example configuration
error_log logs/error.log notice;
working_directory /usr/local/nginx;
http {
include mime.types;
default_type application/octet-stream;
server {
listen 80;
#
# This location could be used to retrieve files from MogileFS.
# It is publicly available.
#
location /download/ {
#
# Query tracker at 192.168.2.2 for a file with the key
# equal to remaining part of request URI
#
mogilefs_tracker 192.168.2.2;
mogilefs_domain example_domain;
mogilefs_pass {
proxy_pass $mogilefs_path;
proxy_hide_header Content-Type;
proxy_buffering off;
}
}
#
# This location could be used to store or delete files in MogileFS.
# It may be configured to be accessable only from local network.
#
location /upload/ {
allow 192.168.2.0/24;
deny all;
mogilefs_tracker 192.168.2.2;
mogilefs_domain example_domain;
mogilefs_methods PUT DELETE;
mogilefs_pass {
proxy_pass $mogilefs_path;
proxy_hide_header Content-Type;
proxy_buffering off;
}
}
}
}
Requirements
nginx 0.7.1 or above is required to compile this module.
Download
Latest version 1.0.3:
or go to download area
Browse repository
http://github.com/vkholodkov/nginx-mogilefs-module/tree/master
How to use
Download sources from one of the links above. Unpack the archive:
tar xvzf nginx_mogilefs_module-1.0.3.tar.gz
Configure nginx with additional module:
cd <path to nginx sources>
./configure --add-module=<path to mogilefs module sources>
make
make install
Nginx
nginx -- is a web-server, developed by Igor Sysoev.
Licence
The above-described module is an addition to nginx web-server, nevertheless they are independent products. The licence of above-described module is BSD You should have received a copy of license along with the source code. By using the materials from this site you automatically agree to the terms and conditions of this license. If you don't agree to the terms and conditions of this license, you must immediately remove from your computer all materials downloaded from this site.
Contact author
Valery Kholodkov valery+nginx@grid.net.ru
Please use address extension while composing an Email to me.
Copyright (C) 2009 Valery Kholodkov
分享到:
相关推荐
《FastDFS-Nginx-Module V1.19:构建高效稳定的文件服务器系统》 FastDFS-Nginx-Module V1.19 是一个专为Nginx设计的FastDFS扩展模块,它允许Nginx直接与FastDFS进行交互,从而实现高效的文件上传和下载服务。...
标题中的"fastdfs-nginx-module_v1.16.tar.gz"是一个开源项目,它是一个用于Nginx服务器的模块,旨在使Nginx能够与FastDFS文件存储系统无缝集成。FastDFS是一个轻量级的开源分布式文件系统,适用于互联网和企业内部...
《深入解析fastdfs-nginx-module_v1.16.tar.gz:构建高效文件服务器的利器》 在现代互联网应用中,文件存储与传输是不可或缺的一部分。FastDFS作为一个轻量级、高性能的分布式文件系统,因其简单易用、稳定可靠的...
Lua-Nginx-Module,简称lua-nginx-module,是Nginx服务器的一个重要扩展模块,它将强大的Lua脚本语言集成到Nginx中,允许用户在Nginx配置文件中直接编写Lua代码,极大地增强了Nginx的功能性和灵活性。版本0.10.13是...
本文将详细解析如何将FastDFS的Nginx模块(fastdfs-nginx-module-1.20.zip)安装并配置到Nginx中,实现高效、稳定的服务。 首先,确保你已经安装了FastDFS和Nginx的基础环境。FastDFS提供了数据存储和文件管理的...
Nginx-Module-VTS是Nginx的一个增强模块,主要功能是提供详细的Web服务器访问统计和性能监控。Prometheus是一款流行的开源监控和警报工具,广泛用于收集和分析各种系统的指标。在本场景中,Nginx-Module-VTS与...
《FastDFS-Nginx-Module V1.20详解及应用实践》 FastDFS-Nginx-Module是针对FastDFS分布式文件系统的一款扩展模块,它主要用于整合Nginx web服务器,实现通过Nginx直接访问FastDFS存储的文件,极大地提高了文件服务...
《FastDFS-Nginx-Module 1.24:高效文件服务器集成详解》 FastDFS-nginx-module 1.24 是一个针对 FastDFS 文件系统的 Nginx 模块,它使得 Nginx 可以无缝地与 FastDFS 集成,提供了高效的文件上传、下载服务。这一...
《FastDFS-Nginx-Module 1.22:构建高效Web服务器的融合解决方案》 在互联网服务领域,Nginx以其高效的性能和强大的反向代理能力被广泛应用于Web服务器,而FastDFS作为轻量级的分布式文件系统,能够有效地解决...
在这个场景下,`fastdfs-nginx-module.zip`扮演着关键的角色,它是FastDFS与Nginx之间的重要桥梁。 FastDFS通常与Nginx结合使用,Nginx作为一个强大的反向代理和负载均衡服务器,负责接收HTTP请求,然后将这些请求...
《headers_more_nginx_module_0.34:深入解析Nginx扩展模块的增强功能》 在Web服务器领域,Nginx以其高性能、高并发能力而广受赞誉。而headers_more_nginx_module作为Nginx的一个扩展模块,进一步提升了其在处理...
总结来说,`fastdfs-nginx-module-master.zip`提供的FastDFS-nginx-module是实现Nginx与FastDFS集成的重要桥梁,它简化了文件服务的部署和管理,提高了文件服务的性能。通过理解和掌握这个模块的使用,开发者可以...
Lua-nginx-module是Nginx服务器的一个扩展模块,它允许我们在Nginx配置文件中直接嵌入 Lua 脚本,极大地增强了Nginx的功能性和灵活性。这个"lua-nginx-module-master.zip"压缩包包含了该模块的源代码,是安装和...
3. 接着,编译并安装Nginx,同时将Fastdfs-nginx-module_v1.19源码编译进Nginx。 4. 配置Nginx的配置文件,设置FastDFS的相关参数,如tracker服务器的地址、连接超时时间等。 5. 最后,启动Nginx服务,测试能否正常...
1. 解压文件:首先,我们需要解压"fastdfs-nginx-module_v1.10.tar.gz",这可以通过命令`tar -zxvf fastdfs-nginx-module_v1.10.tar.gz`完成。 2. 配置Nginx源码:在Nginx源码目录下,执行以下命令,将FastDFS-...
《深入理解echo-nginx-module与Nginx的协同工作》 在Web服务器的世界里,Nginx以其高性能、高并发的特性受到了广泛的关注。而为了更好地优化和调试Nginx的配置,开发者们开发了一系列的模块,其中echo-nginx-module...
《Lua在Nginx中的应用:Lua-Nginx-Module 0.10.9rc7详解》 Lua-Nginx-Module是Nginx服务器中一个强大的扩展模块,允许我们在Nginx配置文件中直接嵌入Lua脚本,极大地提高了Nginx处理动态请求的能力。本文将详细探讨...