欧美一区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號

主站蜘蛛池模板: 康马县| 宣城市| 昌黎县| 吉安县| 台江县| 黄浦区| 庄浪县| 安平县| 时尚| 西城区| 延边| 维西| 桦甸市| 壶关县| 中宁县| 安陆市| 长汀县| 和平区| 遂宁市| 武乡县| 淮南市| 高陵县| 金寨县| 南岸区| 克东县| 湖南省| 富源县| 平泉县| 明星| 大城县| 山阳县| 铁岭县| 静安区| 河北区| 得荣县| 靖西县| 枣庄市| 睢宁县| 基隆市| 隆昌县| 鄂尔多斯市|