下载地址:

wiki.nginx.org/HttpUploadModule

wiki.nginx.org/HttpUploadProgressModule

下载后解压至:/usr/src/文件夹下,其实这个随便放。

nginx.org

下方是rpm安装文件,自行下载.gz源码文件编译。

编译安装nginx 需要事先安装 yum install pcre-devel  openssl-devel  等库

http://nginx.org/packages/centos/6/x86_64/RPMS/nginx-1.2.7-1.el6.ngx.x86_64.rpm

以下参数 为安装文件产生的 configure  问题不大 适合CENTOS

rpm -ivh nginx-1.2.7-1.el6.ngx.x86_64.rpm

 ./configure --add-module=/usr/src/nginx-upload-module-2.2  --add-module=/usr/src/nginx-upload-progress-module --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-http_spdy_module --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'

 make
make install

查看configure

nginx -V

安装完成后如果没有生成用户则自己新建

 adduser -d /var/cache/nginx -s /sbin/nologin nginx

配置文件

user  nginx;
worker_processes 1; error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid; events {
worker_connections 1024;
} http {
include /etc/nginx/mime.types;
default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on;
#tcp_nopush on; keepalive_timeout 65; #gzip on; upload_progress jsinguploads 1m; include /etc/nginx/conf.d/*.conf;
}
server {
listen 80;
server_name _; client_max_body_size 500m; #charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main; location / {
root /home/wwwroot/docs;
index index.php;
} location /upload_client {
# Pass altered request body to this location
upload_pass /uploadhandler;
# Store files to this directory
# The directory is hashed, subdirectories 0 1 2 3 4 5 6 7 8 9 should exist
# 请自行建好这些文件夹,系统不会自动建。
upload_store /home/wwwroot/docs/up_tmp 1;
# Allow uploaded files to be read only by user
upload_store_access user:r;
# Set specified fields in request body
upload_set_form_field $upload_field_name.name "$upload_file_name";
upload_set_form_field $upload_field_name.content_type "$upload_content_type";
upload_set_form_field $upload_field_name.path "$upload_tmp_path";
# Inform backend about hash and size of a file
upload_aggregate_form_field "$upload_field_name.md5" "$upload_file_md5";
upload_aggregate_form_field "$upload_field_name.size" "$upload_file_size";
upload_pass_form_field "^submit$|^description$";
upload_limit_rate 50k;
upload_cleanup 400 404 499 500-505;
track_uploads jsinguploads 30s;
} location /uploadhandler {
rewrite ^(.*)$ /index.php last;
} location ^~ /progress {
# report uploads tracked in the 'proxied' zone
upload_progress_json_output;
report_uploads jsinguploads;
} error_page 404 /404.html; # redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root /home/wwwroot/docs;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
} }

nginx 编译安装支持 upload progress module, upload module的更多相关文章

  1. nginx编译安装支持lua脚本

    一.准备编译环境 1.操作系统:CentOS7.6 2.安装编译所需安装包 yum install gcc pcre pcre-devel zlib zlib-devel openssl openss ...

  2. [linux] Nginx编译安装错误error: the HTTP rewrite module requires the PCRE library

    nginx编译错误: 执行如下命令安装缺少的文件即可

  3. Nginx编译安装lua-nginx-module

    lua-nginx-module 模块可以将Lua的强大功能嵌入NGINX服务器. 下载Nginx源码 如果已安装Nginx,需要查看当前安装版本的编译参数: $ /usr/local/nginx/s ...

  4. LNMP平台搭建之一:nginx编译安装

    参考博客:https://www.cnblogs.com/zhang-shijie/p/5294162.html   jack.zhang 一.环境说明 系统环境:centos6.5 [root@lo ...

  5. Linux下nginx编译安装教程和编译参数详解

    这篇文章主要介绍了Linux下nginx编译安装教程和编译参数详解,需要的朋友可以参考下 一.必要软件准备1.安装pcre 为了支持rewrite功能,我们需要安装pcre 复制代码代码如下: # y ...

  6. Nginx编译安装第三方模块http_substitutions_filter_module2222

    Nginx编译安装第三方模块http_substitutions_filter_module Rming -- 阅读 安装 Http 编译 module filter nginx 模块 >> ...

  7. Nginx编译安装第三方模块http_substitutions_filter_module

    Nginx编译安装第三方模块http_substitutions_filter_module 分类:服务器技术  作者:rming  时间:-- . >>ngx_http_substitu ...

  8. Nginx编译安装相关参数

    Nginx编译安装相关参数 Nginx插件安装 ------------------pcre------------------ cd /usr/local/source wget http://ww ...

  9. nginx编译安装

    Nginx编译安装 1.nginx官网:http://wiki.nginx.org/Install下载:http://nginx.org/en/download.html 2.编译安装# wget h ...

  10. Nginx编译安装:

    第三方模块 在nginx.org   --------  wiki  找 --add-module=   添加 Nginx编译安装: 安装开发环境 ]# yum groupinstall " ...

随机推荐

  1. 一些常用计算机快捷键和dos命令

    1.window常用快捷键 ctrl V 粘贴 ctrl C 复制 ctrl A 全选 ctrl X 剪切 ctrl Z 撤销 ctrl S 保存 ALT F4 关闭窗口 shirt delete 永 ...

  2. fabric学习笔记5

    fabric学习笔记5 20201303张奕博 2023.1.15 fabric中的docker命令 1.查看本机的镜像列表 docker images 2.拉取镜像 docker pull hype ...

  3. Java 8 在使用内存爆了以后会发生什么?hs_err_pid 日志如何看?

    问题: Java进程被终止了,然后在应用的目录中发现了hs_err_pid日志. 运维反馈,结论是内存不够了 之前一直运行没有问题,没什么新增访问量,为什么会内存溢出,进程被killer掉类? 1.第 ...

  4. scrapy_redis 分布式爬取酷狗音乐

    目录 声明 安装scrapy_redis 创建scrapy项目 spider模块 items模块.pipelines模块 setting.py 调试 运行 成果图 源码 声明 文章仅供学习交流使用,切 ...

  5. ALBERT论文简读

    问题描述 预训练自然语言表征时,增加模型的参数量通常可以是模型在下有任务中性能提升.但是这种做法对硬件设备的要求较高(当下的各种SOTA模型动辄数亿甚至数十亿个参数,倘若要扩大模型规模,这个内存问题是 ...

  6. 利用for循环同步执行异步方法

    //定义一个异步函数 const foo1 = (i) => { return new Promise((resolve, reject) => { setTimeout(() => ...

  7. 通过pxelinux引导管理器网络引导slax linux

    前提条件 1.用于引导服务器具备tftp服务和http服务: 2.使用syslinux项目下lpxelinux.0做为pxe引导文件,原因:测试发现lpxelinux.0对http协议支持更好,可以更 ...

  8. (已经成功部署)配置vue+nginx+uwsgi luffy项目

    2019-9-16 21:16:17 由于超哥视频翻车,应该是先改api.js中的IP 再打包 然后按照原来一步一步部署vue uwsgi  Nginx 然后就可以直接访问了!!! 昨天其实就完成,只 ...

  9. Linux系统安全:SNAT和DNAT的实现

    一.SNAT1.SNAT实验目的公司内有2台机器,但是只有一个公网ip,利用SNAT技术实现2台私网地址都可以访问公网. 2.SNAT实验环境准备①三台服务器:PC1客户端.PC2网关.PC3服务端. ...

  10. npm ERR! Failed at the node-sass@4.14.1 postinstall script.

    我们后台要了前端源代码,启动Vue项目后出现了这几行出错信息 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! node-sass@4.14.1 p ...