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

主站蜘蛛池模板: 陆良县| 耿马| 呼伦贝尔市| 海伦市| 镇平县| 兴隆县| 汾阳市| 手机| 通江县| 灵寿县| 通许县| 嘉定区| 白城市| 织金县| 含山县| 高陵县| 卢湾区| 遵化市| 新民市| 林芝县| 无棣县| 乌鲁木齐县| 武平县| 辽中县| 太仆寺旗| 蓬莱市| 綦江县| 湟源县| 离岛区| 丹寨县| 炉霍县| 仲巴县| 平安县| 原阳县| 郴州市| 嵊泗县| 灵石县| 马关县| 农安县| 白玉县| 柳林县|