https://www.jianshu.com/p/cfa60fdc03d1
启动
nginx
停止
nginx -s stop
版本号
nginx -v
重加载
nginx -s reload
root
和alias
的区别
location /a {
alias|root html;
index index.html index.htm;
autoindex on;
}
- 使用root,访问xxx/a的时候,会去html/a的目录下找(最终的路径包含location指定的/a)
- 使用alias,访问xxx/a的时候,会去html/下找(最终的路径不包含location指定的/a)
server {
listen 81;
server_name localhost;
location / {
root /data;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
}