server {
listen 89;
server_name localhost;
location / {
root blog;
index index.html;
}
}
说明一下,listen后面跟着的89是咱的监听端口 server_name 后填域名 然后就是location配置,因为我之前把blog文件夹放在外面,所以直接写blog
打开nginx.conf
在这个位置添加
然后保存
nginx - t
好的,说明我们的配置没有问题了,直接开服务器
在命令提示符里直接输入nginx
访问成功!
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。