如何配置nginx静态文件服务器
server {
listen 999;
server_name test;
location / {
root /temp/; #指定文件所在目录
autoindex on;#开启目录的关键命令
}
}
如果做反向代理 只需要在 location中添加
proxy_pass http://www.renren.com;
另外注意 linux 中111端口是被系统保留,如果用ngnix监听111端口的话,是不会生效的。
Jerryhuhappy 博主文章分类:linux ©著作权
如何配置nginx静态文件服务器
server {
listen 999;
server_name test;
location / {
root /temp/; #指定文件所在目录
autoindex on;#开启目录的关键命令
}
}
如果做反向代理 只需要在 location中添加
proxy_pass http://www.renren.com;
另外注意 linux 中111端口是被系统保留,如果用ngnix监听111端口的话,是不会生效的。
在docs目录下,是一个完整的html静态页面,接下来我们用nginx将其部署。配置完毕之后,执行nginx -s reload,将nginx配置重新加载。但是,根目录如
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M