最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

CentOS利用Nginx搭建下載功能服務(wù)器

 更新時間:2017年06月23日 23:43:46   投稿:mdxy-dxy  
這篇文章主要介紹了CentOS利用Nginx搭建下載功能服務(wù)器,需要的朋友可以參考下

利用nginx在服務(wù)器搭建下載功能,

安裝Nginx,pcre
mkdir /usr/local/nginx
tar zxvf pcre-8.12.tar.gz
cd pcre-8.12
./configure --prefix=/usr/local/pcre
make && make install
tar zxvf nginx-1.0.12.tar.gz

tar zxvf nginx-1.0.12.tar.gz
cd nginx-1.0.12
./configure --prefix=/usr/local/nginx/ --with-pcre=/opt/pcre-8.12
make && make install
vi /usr/local/nginx/conf/nginx.conf

#user www www;
worker_processes 8;
error_log /usr/local/nginx/logs/error.log crit;
pid    /usr/local/nginx/logs/nginx.pid;
 
worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 010000
00 10000000;
worker_rlimit_nofile 51200;
 
events {
    use epoll;
    worker_connections 51200;
}
 
http {
   include    mime.types;
  default_type application/octet-stream;
  server_names_hash_bucket_size 128;
  client_header_buffer_size 32k;
  large_client_header_buffers 4 32k;
  client_max_body_size 8m;
  access_log off;
  sendfile on;
  tcp_nodelay on;
  tcp_nopush   on;
  keepalive_timeout 30;
 
  fastcgi_connect_timeout 300;
  fastcgi_send_timeout 300;
  fastcgi_read_timeout 300;
  fastcgi_buffer_size 32k;
  fastcgi_buffers 8 32k;
  fastcgi_busy_buffers_size 128k;
  fastcgi_temp_file_write_size 256k;
  fastcgi_intercept_errors on;
  open_file_cache max=51200 inactive=20s;
  open_file_cache_valid 30s;
  open_file_cache_min_uses 1;
 
  gzip on;
  gzip_min_length 1k;
  gzip_buffers   4 16k;
  gzip_http_version 1.0;
  gzip_comp_level 2;
  gzip_types    text/plain application/x-javascript text/css application/xml;
  gzip_vary on;
  #if you modify nginx source,please hidden follow
  #server_tokens off;
  log_format access '$remote_addr - $remote_user [$time_local] "$request" '
    '$status $body_bytes_sent "$http_referer" '
    '"$http_user_agent" $http_x_forwarded_for';
    include     /usr/local/nginx/conf/vhost/*.conf;
}

虛擬主機配置

mkdir /usr/local/nginx/conf/vhost
cd /usr/local/nginx/conf/vhost
vi hosts.conf

server {
  listen    80;
  server_name 42.62.XX.
  index index.html index.htm index.php;
  root /game/;
 
 
  error_page 502 = /502.html;
  location ~* ^/upload/.*\.(php|php5)$ {
          deny all;
  }
#  location ~ .*\.(php|php5)?$ {
#        #fastcgi_pass unix:/tmp/php-cgi.sock;
#    fastcgi_pass 127.0.0.1:9000;
#    fastcgi_index index.php;
#    include fastcgi.conf;
#  }
 
 
  location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|mp3)$ {
    expires   30d;
  }
 
  location ~ .*\.(js|css)?$ {
    expires   12h;
  }
#access_log /data/webroot/nginx/logs/access.log access;
#error_log /data/webroot/nginx/logs/error.log error;
}

#/usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx//conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx//conf/nginx.conf test is successful

#/usr/local/nginx/sbin/nginx -s reload

此時在服務(wù)器上創(chuàng)建 /game 目錄, 把需要被下載的資源放目錄里面就可以了。

相關(guān)文章

  • Nginx?配置?HTTPS的詳細(xì)過程

    Nginx?配置?HTTPS的詳細(xì)過程

    這篇文章主要介紹了Nginx?配置?HTTPS?完整過程,包括nginx?的?ssl?模塊安裝,ssl?證書部署,nginx.conf?配置,重啟?nginx無信息提示就成功啦,本文給大家介紹的非常詳細(xì),需要的朋友可以參考下
    2022-05-05
  • 使用nginx緩存服務(wù)器上靜態(tài)文件的設(shè)置方法

    使用nginx緩存服務(wù)器上靜態(tài)文件的設(shè)置方法

    這篇文章主要介紹了使用nginx緩存服務(wù)器上的靜態(tài)文件,文中給大家提到了nginx緩存的優(yōu)點及設(shè)置方法,通過實例相結(jié)合的形式給大家介紹的非常詳細(xì),需要的朋友可以參考下
    2018-05-05
  • nginx模塊stream配置的具體使用

    nginx模塊stream配置的具體使用

    stream模塊一般用于tcp/UDP數(shù)據(jù)流的代理和負(fù)載均衡,可以通過stream模塊代理轉(zhuǎn)發(fā)TCP消息,本文主要介紹了nginx模塊stream配置的具體使用,感興趣的可以了解一下
    2023-10-10
  • 使用 Nginx 部署靜態(tài)頁面的方法

    使用 Nginx 部署靜態(tài)頁面的方法

    本篇文章主要介紹了使用 Nginx 部署靜態(tài)頁面的方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-06-06
  • Nginx+Tomcat搭建高性能負(fù)載均衡集群的實現(xiàn)方法

    Nginx+Tomcat搭建高性能負(fù)載均衡集群的實現(xiàn)方法

    這篇文章主要介紹了Nginx+Tomcat搭建高性能負(fù)載均衡集群的實現(xiàn)方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-03-03
  • nginx: [warn]

    nginx: [warn] "log_format" directive used only on "http" lev

    這篇文章主要介紹了nginx: [warn] "log_format" directive used only on "http" level 解決方法,需要的朋友可以參考下
    2014-08-08
  • Nginx反向代理多域名的HTTP和HTTPS服務(wù)的實現(xiàn)

    Nginx反向代理多域名的HTTP和HTTPS服務(wù)的實現(xiàn)

    這篇文章主要介紹了Nginx反向代理多域名的HTTP和HTTPS服務(wù)的實現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-06-06
  • Nginx HTTPS實現(xiàn)原理及配置實踐

    Nginx HTTPS實現(xiàn)原理及配置實踐

    本文主要介紹了Nginx HTTPS實現(xiàn)原理及配置實踐,詳細(xì)的介紹了HTTPS原理,實現(xiàn)及其HTTPS單臺配置實踐,集群配置、優(yōu)化等,具有一定的參考價值,感興趣的可以了解一下
    2023-09-09
  • 使用nginx+二級域名+https支持

    使用nginx+二級域名+https支持

    這篇文章主要介紹了使用nginx+二級域名+https支持,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-05-05
  • 服務(wù)器報錯nginx?502?Bad?Gateway的原因及如何解決詳解

    服務(wù)器報錯nginx?502?Bad?Gateway的原因及如何解決詳解

    項目啟動時莫名其妙網(wǎng)站訪問不了,502 Bad Gateway,下面這篇文章主要給大家介紹了關(guān)于服務(wù)器報錯nginx?502?Bad?Gateway的原因及如何解決的相關(guān)資料,文中通過實例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2023-06-06

最新評論

黑山县| 扶风县| 崇阳县| 焦作市| 静乐县| 塔河县| 剑阁县| 卢氏县| 清镇市| 蕉岭县| 叙永县| 卓尼县| 商城县| 台中县| 轮台县| 沙雅县| 中超| 广河县| 柳江县| 札达县| 青铜峡市| 西乌珠穆沁旗| 稻城县| 琼中| 堆龙德庆县| 南京市| 汉沽区| 房山区| 临安市| 彰化市| 都昌县| 丰原市| 邵阳县| 闸北区| 潞城市| 兴安县| 六盘水市| 浦东新区| 怀集县| 长乐市| 广河县|