ユニバーサルビルド環境設定コマンド
yumをインストールGCCのgcc-C ++のautomake PCRE PCRE-develのzlipのzlib-develのopensslのopensslの-develの
1.ダウンロードnginxのバージョン(2019年8月13日現在のバージョン1.16.1)
$ wget http://nginx.org/download/nginx-1.16.1.tar.gz
$ useradd -d /home/nginx -m nginx
$ tar -zxvf nginx-1.16.1.tar.gz
$ cd nginx-1.16.1
$ ./configure --user=nginx --group=nginx --prefix=/home/nginx --with-http_stub_status_module --with-http_ssl_module --with-stream
$ make
$ make install
$ Server構成ファイル
server {
listen 端口;
server_name localhost;
access_log /home/nginx/download.log;
charset utf-8;
root /home/ftp;
location / {
autoindex_exact_size off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
client_max_body_size 100m;
client_body_buffer_size 128k;
proxy_connect_timeout 1200;
proxy_read_timeout 1200;
proxy_send_timeout 6000;
proxy_buffer_size 32k;
proxy_buffers 4 64k;
proxy_busy_buffers_size 128k;
proxy_temp_file_write_size 128k;
autoindex on;
limit_rate_after 25m; ## 达到最大带宽时开始限制
limit_rate 25m; ## 带宽限制
if ($request_filename ~* ^.*?\.(jar|txt|doc|pdf|rar|gz|zip|docx|exe|xlsx|ppt|pptx)$){
add_header Content-Disposition: 'attachment;';
}
}
}
--------------------------スタート/パリティ/ストップ----------------
アクセスアドレス:HTTP:// IP:ポート/
設定ファイルにエラーがあることを確認してください
$。/ nginxの-t
設定ファイルを指定します
$。/ nginxの-c /home/nginx/conf/nginx.conf
エレガント停止
$。/ nginxの-s停止