欧美一区2区三区4区公司二百,国产精品婷婷午夜在线观看,自拍偷拍亚洲精品,国产美女诱惑一区二区

歡迎來到云服務(wù)器

服務(wù)器租用

Nginx處事器的常用設(shè)置進(jìn)修條記

 

Nginx
    nginx [engine x] is an HTTP and reverse proxy server, a mail proxy server, and a generic TCP/UDP proxy server, originally written by Igor Sysoev. For a long time, it has been running on many heavily loaded Russian sites including Yandex, Mail.Ru, VK, and Rambler. According to Netcraft, nginx served or proxied 25.64% busiest sites in April 2016. Here are some of the success stories: Netflix, Wordpress.com, FastMail.FM.
    The sources and documentation are distributed under the 2-clause BSD-like license.
    Commercial support is available from Nginx, Inc.

Nginx處事器的常用設(shè)置進(jìn)修條記

 

Nginx是一款輕量級的Web處事器/反向署理處事器電子郵件(IMAP/POP3)署理處事器,由俄羅斯工程師Igor
Sysoev開拓,供俄國大型進(jìn)口網(wǎng)站及搜索引擎Rambler利用.其源代碼以BSD-like協(xié)議宣布.
其特點是內(nèi)存占用少,并發(fā)本領(lǐng)強,
因此被海內(nèi)許多大型網(wǎng)站(如京東/淘寶)回收.
(主頁/先容/文檔).

 


編譯安裝

目次 描寫
conf nginx設(shè)置文件
html 網(wǎng)頁文件
logs nginx日志文件
sbin nginx可執(zhí)行文件

/usr/local/nginx/sbin/nginx
啟動, Nginx默認(rèn)占用80端口,可在nginx.conf中變動.


Nginx信號

關(guān)于Linux信號相關(guān)常識, 可參考系列博客Linux信號實踐, 在此, 我們僅先容Nginx捕捉的幾個信號.

nginx can be controlled with signals.

信號名 浸染
TERM/INT fast shutdown
QUIT graceful shutdown
HUP changing configuration, keeping up with a changed time zone , starting new worker processes with a new configuration, graceful shutdown of old worker processes
USR1 re-opening log files
USR2 upgrading an executable file
WINCH graceful shutdown of worker processes

以上信號浸染亦可通過編譯出的nginx二進(jìn)制文件實現(xiàn):

To start nginx, run the executable file. Once nginx is started,
it can be controlled by invoking the executable with the -s
parameter. Use the following syntax:
nginx -s signal


設(shè)置
"hljs-preprocessor">#運行處事的用戶及用戶組 
#user  nobody;
#事情歷程數(shù)(一般配置為CPU數(shù)*焦點數(shù))
worker_processes  ;
#全局錯誤日志(位置/級別) 
#error_log  logs/ "hljs-keyword">error.log;
#error_log  logs/ "hljs-keyword">error.log  notice;
#error_log  logs/ "hljs-keyword">error.log  info;
#PID文件
#pid        logs/nginx.pid;
#事情模式及毗連數(shù)上限
events {
    # 回收epoll舉辦IO復(fù)用
    # use epoll;
    # 單歷程所答允的最大毗連數(shù)
    worker_connections  ;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
"hljs-preprocessor">#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
"hljs-preprocessor">#                  '$status $body_bytes_sent "$http_referer" '
"hljs-preprocessor">#                  '"$http_user_agent" "$http_x_forwarded_for"';
"hljs-preprocessor">#access_log  logs/access.log  main;
    #是否激活sendfile()函數(shù)
    sendfile        on;
"hljs-preprocessor">#將HTTP響應(yīng)頭壓縮到一個包中發(fā)送,僅在sendfile開啟時才氣利用
    #tcp_nopush     on;
    #keepalive_timeout  0;
    keepalive_timeout  ;
    #開啟gzip模塊
    #gzip  on;
    #設(shè)定虛擬主機,默認(rèn)監(jiān)聽80端口,可設(shè)置多個
    server {
        listen       ;
        server_name  localhost;
        #charset koi8-r;
"hljs-preprocessor">#access_log  logs/host.access.log  main;
        # 頁面存放位置
        location / {
            # 頁面存放根目次
            root   html;
            # 默認(rèn)頁面
            index  index.html index.htm;
        }
"hljs-preprocessor">#error_page  404              /404.html;
"hljs-preprocessor"># redirect server  "hljs-keyword">error pages to the static page /50x.html
        #
        error_page        /x.html;
        location = /x.html {
            root   html;
        }
"hljs-preprocessor"># proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ .php$ {
"hljs-preprocessor">#    proxy_pass   http://127.0.0.1;
        #}
"hljs-preprocessor"># pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ .php$ {
"hljs-preprocessor">#    root           html;
"hljs-preprocessor">#    fastcgi_pass   127.0.0.1:9000;
"hljs-preprocessor">#    fastcgi_index  index.php;
"hljs-preprocessor">#    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
"hljs-preprocessor">#    include        fastcgi_params;
        #}
"hljs-preprocessor"># deny access to .htaccess files,  "hljs-keyword">if Apache's document root
"hljs-preprocessor"># concurs with nginx's one
        #
        #location ~ /.ht {
        #    deny  all;
        #}
    }
"hljs-preprocessor"># another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
"hljs-preprocessor">#    listen       somename:8080;
"hljs-preprocessor">#    server_name  somename  alias  another.alias;
    #    location / {
    #        root   html;
"hljs-preprocessor">#        index  index.html index.htm;
    #    }
    #}
    # HTTPS server
    #
    #server {
"hljs-preprocessor">#    listen       443 ssl;
"hljs-preprocessor">#    server_name  localhost;
"hljs-preprocessor">#    ssl_certificate      cert.pem;
"hljs-preprocessor">#    ssl_certificate_key  cert.key;
"hljs-preprocessor">#    ssl_session_cache    shared:SSL:1m;
"hljs-preprocessor">#    ssl_session_timeout  5m;
"hljs-preprocessor">#    ssl_ciphers  HIGH:!aNULL:!MD5;
"hljs-preprocessor">#    ssl_prefer_server_ciphers  on;
    #    location / {
    #        root   html;
"hljs-preprocessor">#        index  index.html index.htm;
    #    }
    #}
}


Server

在Nginx內(nèi)可設(shè)置虛擬主機, 只需在nginx.conf中添加一個server元素:

騰訊云代理

Copyright © 2003-2021 MFISP.COM. 國外vps服務(wù)器租用 夢飛云服務(wù)器租用 版權(quán)所有 ? 粵ICP備11019662號

主站蜘蛛池模板: 伽师县| 怀柔区| 青州市| 西藏| 海林市| 瑞安市| 莱阳市| 容城县| 衡水市| 凤翔县| 仲巴县| 新密市| 饶阳县| 开平市| 永康市| 航空| 康定县| 股票| 唐河县| 泾源县| 长泰县| 沐川县| 广宗县| 饶河县| 白玉县| 香港 | 灌阳县| 永川市| 石家庄市| 搜索| 门头沟区| 鄂托克前旗| 淮阳县| 石城县| 云和县| 都安| 罗定市| 樟树市| 宁陕县| 象州县| 辽阳县|