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

歡迎來到云服務器

服務器租用

利用nginx時常見的錯誤以及辦理步伐

許多人都可以遇到一個陷阱。下面我們列出,我們常常看到的問題,以及表明如何辦理這些問題。在Freenode上的#nginx IRC頻道這些接頭很頻繁。

1、權限

從來不要利用777權限,查察目次的權限

2、root配置

BAD:

server {
    server_name www.example.com;
    location / {
        root /var/www/nginx-default/;
        # [...]
      }
    location /foo {
        root /var/www/nginx-default/;
        # [...]
    }
    location /bar {
        root /var/www/nginx-default/;
        # [...]
    }
}

GOOD:

server {
    server_name www.example.com;
    root /var/www/nginx-default/;
    location / {
        # [...]
    }
    location /foo {
        # [...]
    }
    location /bar {
        # [...]
    }
}
3、索引配置

BAD:

http {
    index index.php index.htm index.html;
    server {
        server_name www.example.com;
        location / {
            index index.php index.htm index.html;
            # [...]
        }
    }
    server {
        server_name example.com;
        location / {
            index index.php index.htm index.html;
            # [...]
        }
        location /foo {
            index index.php;
            # [...]
        }
    }
}

GOOD:

http {
    index index.php index.htm index.html;
    server {
        server_name www.example.com;
        location / {
            # [...]
        }
    }
    server {
        server_name example.com;
        location / {
            # [...]
        }
        location /foo {
            # [...]
        }
    }
}
4、Using If

if 是邪惡的 拜見 If Is Evil

5、Server Name (If)

BAD:

server {
    server_name example.com *.example.com;
        if ($host ~* ^www.(.+)) {
            set $raw_domain $1;
            rewrite ^/(.*)$ $raw_domain/$1 permanent;
        }
        # [...]
    }
}

每次都要檢測主機頭,這是低效的,你應該制止,推薦利用下面的

GOOD:

騰訊云代理

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

主站蜘蛛池模板: 临清市| 拉孜县| 疏勒县| 星子县| 岳普湖县| 平谷区| 高碑店市| 德清县| 刚察县| 工布江达县| 杭州市| 灵武市| 宿松县| 巴塘县| 海门市| 正阳县| 宣武区| 上栗县| 平武县| 同仁县| 临西县| 包头市| 安仁县| 洱源县| 佛教| 家居| 黔东| 平定县| 花莲市| 宁河县| 北京市| 玉门市| 博野县| 井研县| 威信县| 磐安县| 盘锦市| 拜城县| 赣州市| 仲巴县| 江山市|