Nginx安装与服务部署

网友投稿 814 2022-09-04

Nginx安装与服务部署

Nginx安装与服务部署

Nginx安装与服务部署

nginx安装

a.安装编译工具及库文件

yum -y install make wget gcc-c++ libtool openssl openssl-devel zlib zlib-devel

b.-PCRE

mkdir -p /data/software cd /data/software wget http://downloads.sourceforge-/project/pcre/pcre/8.35/pcre-8.35.tar.gz tar zxvf pcre-8.35.tar.gz

c.安装Nginx

wget http://nginx.org/download/nginx-1.10.2.tar.gz tar -zxvf nginx-1.10.2.tar.gz cd nginx-1.10.2 ./configure --prefix=/data/liang/nginx-upload-main \ --pid-path=/data/logs/nginx-upload-main/nginx.pid \ --lock-path=/data/liang/nginx-upload-main/nginx.lock \ --error-log-path=/data/logs/nginx-upload-main/error.log \ --\ --\ --\ --\ --\ --\ --with-\ --with-\ --with-pcre=/data/software/pcre-8.35 \ --with-http_auth_request_module make make install

配置服务

vim /data/liang/nginx-upload-main/conf/nginx.conf

user root; worker_processes 1; error_log /data/logs/nginx-upload-main/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; pid /data/logs/nginx-upload-main/nginx.pid; events { worker_connections 1024; } http{ access_log /data/logs/nginx-upload-main/access.log; underscores_in_headers on; upstream auth-server { server 127.0.0.1:8080; } upstream upload-server { hash $http_x_liang_uid; server 192.168.1.8:80; server 192.168.1.9:80; } upstream check-server { server 192.168.1.8:8080; server 192.168.1.9:8080; } server { listen 80; client_max_body_size 100m; location ~/media/file/\S+/checksum{ auth_request /auth; auth_request_set $auth_status $upstream_status; proxy_pass http://check-server; } location ~/media/file/\S+/upload { auth_request /auth; auth_request_set $auth_status $upstream_status; proxy_pass http://upload-server; } location = /auth { internal; proxy_pass http://auth-server; proxy_set_header Content-Length ""; } }

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:一次 sql 优化经历,太有趣了!(一次就怀孕的几率大吗)
下一篇:美国大选2020推特相关数据
相关文章

 发表评论

暂时没有评论,来抢沙发吧~