您当前的位置:主页 > 教程合集 > 网站建设 > 网站首页网站建设
Oneinstack建站添加Nginx模块使其支持镜像代理的方法
发布时间:2020-12-10编辑:余斗阅读:(0)字号: 大 中 小
在很久以前,我就推荐过使用Oneinstack进行建站,最近在用Oneinstack准备进行镜像代理时,发现了一个问题————Nginx缺少字符串替换模块,而无法进行替换镜像中的字符。没办法只能手动添加字符串。
操作过程
#先找到Ngnix的源码包,并解压
cd/root/oneinstack/src/
tar zxf nginx-1.12.2.tar.gz
#下载字符串替换模块
wget -O ngx_http_substitutions_filter_module-master.zip https://github.com/yaoweibin/ngx_http_substitutions_filter_module/archive/master.zip
unzip ngx_http_substitutions_filter_module-master.zip
#开始编译
cd nginx-1.12.2
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-1.0.2o --with-pcre=../pcre-8.42 --with-pcre-jit --with-ld-opt=-ljemalloc --with-http_gunzip_module --with-http_sub_module --add-module=/root/oneinstack/src/ngx_http_substitutions_filter_module --with-http_degradation_module --with-stream --with-stream_ssl_module --without-http_autoindex_module --without-http_charset_module --without-http_empty_gif_module --with-http_addition_module
make
#开始替换
service nginx stop
cp/usr/local/nginx/sbin/nginx/usr/local/nginx/sbin/nginx.bak
cp ./objs/nginx/usr/local/nginx/sbin/
service nginx start
这样整个为Nginx添加模块的步骤就完成了。
关键字词:NginxOneinstack镜像代理