手机版国外ip代理软件免费版(安装nginx并代理下载服务器文件)

更新时间:2022-12-07 02:46:19 阅读: 评论:0

手机版国外ip代理软件免费版(安装nginx并代理下载服务器文件)

  KiG动博网

KiG动博网

  主旨KiG动博网

  nginx服务,现在是最好用的一种代理服务,日常我们代理的一般都是端口转发和流量控制,那么我们如何通过nginx来实现文件下载呢?就是通过nginx服务,通过url来下载文件。KiG动博网

  Nginx是一款轻量级的web服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,在BSD-like 协议下发行。其特点是占有内存少,并发能力强,事实上nginx的并发能力在同类型的网页服务器中表现较好。KiG动博网

  环境KiG动博网

  linux服务器KiG动博网

  nginx软件KiG动博网

  软件下载KiG动博网

  公众号“运维家”后台回复“nginx”,即可获取下载地址。KiG动博网

  nginx安装KiG动博网

  1、安装编译工具及库文件KiG动博网

  [yunweijia@localhost jier]$ sudo yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-develKiG动博网

  ‍KiG动博网

  2、安装 PCREKiG动博网

  [yunweijia@localhost jier]$ cd /usr/local/src/KiG动博网

  [yunweijia@localhost src]$ sudo wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz 下载KiG动博网

  [yunweijia@localhost src]$ sudo tar xf pcre-8.35.tar.gz # 解压KiG动博网

  [yunweijia@localhost src]$ cd pcre-8.35/KiG动博网

  [yunweijia@localhost pcre-8.35]$ sudo ./configure # 编译KiG动博网

  [yunweijia@localhost pcre-8.35]$ sudo make && make instal # 安装KiG动博网

  [yunweijia@localhost pcre-8.35]$ pcre-config --version # 版本查看KiG动博网

  8.32KiG动博网

  [yunweijia@localhost pcre-8.35]$KiG动博网

  3、安装nginxKiG动博网

  [yunweijia@localhost jier]$ pwdKiG动博网

  /home/yunweijia/jierKiG动博网

  [yunweijia@localhost jier]$ lsKiG动博网

  nginx-1.14.2.tar.gzKiG动博网

  [yunweijia@localhost jier]$ tar xf nginx-1.14.2.tar.gzKiG动博网

  [yunweijia@localhost jier]$ cd nginx-1.14.2/KiG动博网

  [yunweijia@localhost nginx-1.14.2]$ sudo ./configure --prefix=/home/yunweijia/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.35KiG动博网

  [yunweijia@localhost nginx-1.14.2]$ sudo make && make installKiG动博网

  4、配置调整KiG动博网

  [yunweijia@localhost nginx-1.14.2]$ cd /home/yunweijia/nginx/KiG动博网

  [yunweijia@localhost nginx]$ lsKiG动博网

  conf html logs sbinKiG动博网

  [yunweijia@localhost nginx]$ vim conf/nginx.confKiG动博网

  # 以下内容是配置文件的第二行进行配置KiG动博网

  user root;KiG动博网

  # 以下配置是唉server中进行新增KiG动博网

  location ~* (.*.txt) { # 代理后缀为txt的KiG动博网

  add_header Content-Type "application/octet-stream";KiG动博网

  if ( $args ~ ^filename=(.*) ) {KiG动博网

  add_header Content-Disposition "attachment; filename=$1";KiG动博网

  }KiG动博网

  yunweijia /home/yunweijia/txt/; # 在这个目录下KiG动博网

  }KiG动博网

  5、启动nginxKiG动博网

  [yunweijia@localhost nginx]$ sudo ./sbin/nginx -t # 检查配置KiG动博网

  nginx: the configuration file /home/yunweijia/nginx/conf/nginx.conf syntax is okKiG动博网

  nginx: configuration file /home/yunweijia/nginx/conf/nginx.conf test is successfulKiG动博网

  [yunweijia@localhost nginx]$ sudo ./sbin/nginx # 启动KiG动博网

  6、验证KiG动博网

  在"/home/yunweijia/txt/"中新建文件,测试下载。KiG动博网

  下载url为:http://ip地址:端口号/文件名KiG动博网

  [yunweijia@localhost nginx]$ mkdir /home/yunweijia/txt/KiG动博网

  [yunweijia@localhost nginx]$ cd /home/yunweijia/txt/KiG动博网

  [yunweijia@localhost txt]$ lsKiG动博网

  [yunweijia@localhost txt]$ echo ceshi > 1.txtKiG动博网

  [yunweijia@localhost txt]$ cat 1.txtKiG动博网

  ceshiKiG动博网

  [yunweijia@localhost txt]$KiG动博网

  浏览器输入地址为:KiG动博网

  http://192.168.112.130/1.txtKiG动博网

  文件下载成功。KiG动博网

  至此,用nginx代理文件下载完毕。KiG动博网

KiG动博网

本文发布于:2022-12-07 02:46:19,感谢您对本站的认可!

本文链接:https://www.mbdongbo.com/sports/8/349701.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:
相关文章
Copyright ©2019-2022 Comsenz Inc.Powered by © 动博网 京ICP备13042020号-1