欧美一区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-2019 MFISP.COM. 國外服務器租用 IDC公司 版權所有 ? 粵ICP備11019662號

主站蜘蛛池模板: 峨边| 奎屯市| 城固县| 乌恰县| 会同县| 抚宁县| 古交市| 聊城市| 万安县| 思茅市| 正镶白旗| 于都县| 奎屯市| 重庆市| 鄂伦春自治旗| 海兴县| 昌吉市| 四子王旗| 罗甸县| 永和县| 浠水县| 阿合奇县| 萨嘎县| 利川市| 皮山县| 柏乡县| 吉水县| 郯城县| 邵东县| 雅安市| 清水县| 景宁| 香港 | 当阳市| 新密市| 鲁山县| 柯坪县| 攀枝花市| 洞口县| 正蓝旗| 白水县|