下载与安装
快速配置
定位 > 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
重启