nginx 编译安装支持 upload progress module, upload module
下载地址:
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的更多相关文章
- nginx编译安装支持lua脚本
一.准备编译环境 1.操作系统:CentOS7.6 2.安装编译所需安装包 yum install gcc pcre pcre-devel zlib zlib-devel openssl openss ...
- [linux] Nginx编译安装错误error: the HTTP rewrite module requires the PCRE library
nginx编译错误: 执行如下命令安装缺少的文件即可
- Nginx编译安装lua-nginx-module
lua-nginx-module 模块可以将Lua的强大功能嵌入NGINX服务器. 下载Nginx源码 如果已安装Nginx,需要查看当前安装版本的编译参数: $ /usr/local/nginx/s ...
- LNMP平台搭建之一:nginx编译安装
参考博客:https://www.cnblogs.com/zhang-shijie/p/5294162.html jack.zhang 一.环境说明 系统环境:centos6.5 [root@lo ...
- Linux下nginx编译安装教程和编译参数详解
这篇文章主要介绍了Linux下nginx编译安装教程和编译参数详解,需要的朋友可以参考下 一.必要软件准备1.安装pcre 为了支持rewrite功能,我们需要安装pcre 复制代码代码如下: # y ...
- Nginx编译安装第三方模块http_substitutions_filter_module2222
Nginx编译安装第三方模块http_substitutions_filter_module Rming -- 阅读 安装 Http 编译 module filter nginx 模块 >> ...
- Nginx编译安装第三方模块http_substitutions_filter_module
Nginx编译安装第三方模块http_substitutions_filter_module 分类:服务器技术 作者:rming 时间:-- . >>ngx_http_substitu ...
- Nginx编译安装相关参数
Nginx编译安装相关参数 Nginx插件安装 ------------------pcre------------------ cd /usr/local/source wget http://ww ...
- nginx编译安装
Nginx编译安装 1.nginx官网:http://wiki.nginx.org/Install下载:http://nginx.org/en/download.html 2.编译安装# wget h ...
- Nginx编译安装:
第三方模块 在nginx.org -------- wiki 找 --add-module= 添加 Nginx编译安装: 安装开发环境 ]# yum groupinstall " ...
随机推荐
- Android悬浮窗全屏不获取焦点但是可以漏出软键盘的办法
addFlags( WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);的作用是在不获取焦点的时候显示软键盘. 接触这个标记 getWindow().c ...
- containerd.service containerd-1.6.8-linux-amd64.tar.gz cni-plugins-linux-amd64-v1.1.1.tgz 标准文件下载
配置K8S时 可能会用到#systemcd来管理containerd,这https://raw.githubusercontent.com/containerd/containerd/main/con ...
- Word18 制作家长会通知office真题
1.课程的讲解之前,先来对题目进行分析,首先需要在考生文件夹下,将Wrod素材.docx文件另存为Word.docx,后续操作均基于此文件,否则不得分. 2.这一步非常的简单,打开下载素材文件,在[文 ...
- 信创要求下,FTP要不要替代?要怎么进行国产化替代?
信创在国内如火如荼地发展,无论在技术探索和突破上,还是在政策规划上,都朝着更加完善的方向大步迈进.信创目前在从大的方面来说,信创目前主要集中在基础软件.硬件和芯片上,其中基础软件包括操作系统.数据库. ...
- SAR成像(四):多普勒频移的计算
雷达系统中,雷达与目标间的相互运动会使回波信号产生频移,称为多普勒效应,对应的频移称为多普勒频率. 假设雷达发射信号为单频连续波, f ( t ) = c o s ( 2 π f 0 t + ϕ ) ...
- redis 持久化之RDB和AOF的区别
持久化之RDB 定义:在指定的时间间隔内生成数据集的时间点快照 RDB 的优点: 1.RDB 是一个非常紧凑的文件 它保存了 Redis 在某个时间点上的数据集. 这种文件非常适合用于进行备份: 比如 ...
- Windows 与Docker
https://docs.microsoft.com/zh-cn/windows/wsl/install-manual#step-4---download-the-linux-kernel-updat ...
- docker 安装mongodb
一.安装mongodb 我们首先改一下镜像源,避免拉去速度太慢 创建daemon.json文件:位于/etc/docker目录下: 登录阿里云 即可 2.docker 搜索mongo镜像 然后pull ...
- 快速上手SpringBoot
快速上手SpringBoot SpringBoot是用来简化Spring应用的初始化搭建以及开发过程 三个不需要,这是springboot使用mvc区别于其它框架的特点 tomcatd的端口 下一行是 ...
- 直播带货源码,flutter 顶部滚动栏+页面
直播带货源码,flutter 顶部滚动栏+页面 tabPage.dart import 'package:flutter/cupertino.dart';import 'package:flutter ...