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

主站蜘蛛池模板: 达日县| 茶陵县| 梨树县| 大英县| 大庆市| 河间市| 瑞昌市| 金溪县| 托克逊县| 北票市| 黄龙县| 卢氏县| 饶河县| 宜章县| 明光市| 蒙自县| 调兵山市| 镇安县| 龙井市| 弥勒县| 冀州市| 繁昌县| 稻城县| 康定县| 改则县| 唐河县| 平原县| 广德县| 青田县| 界首市| 封丘县| 衡山县| 旌德县| 武清区| 辽阳市| 嘉鱼县| 高青县| 体育| 贵定县| 营山县| 乐平市|