×

Nginx笔记

96
周鶏
2018.03.18 23:28* 字数 71

下载与安装

http://nginx.org/en/docs/

快速配置

定位 > sudo vim /etc/nginx/nginx.conf,修改:

http {
    server {
        listen 80;
        server_name      xxx.com( or IP address);
        location / {
                root      /xxx/xxx/;
                index      xxx.html;
        }
    }
}

就这么配!over!

或者这么配

定位 > sudo vim /etc/nginx/sites-available/default,修改:

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;

#       root /usr/share/nginx/html;
       root /xxx/xxx;
       index xxx.html;
...
...
}

启动或重启

> sudo nginx 启动
> sudo nginx -s reload 重启

KimiTalk
Web note ad 1