修改 nginx.conf 文件实现。在 Linux 上该文件的路径为 /usr/local/nginx/conf/nginx.conf,Windows 下 安装目录\conf\nginx.conf。
1 |
server { |
2 |
listen 80; |
3 |
server_name localhost; |
4 |
|
5 |
…… |
6 |
} |
改成
01 |
server { |
02 |
listen 81; |
03 |
server_name localhost; |
04 |
|
05 |
location / { |
06 |
root html; |
07 |
index index.html index.htm; |
08 |
} |
09 |
…… |
10 |
} |
当然改成 8080,8081 什么的都可以,不一定要 81,但是确保 iptable 要放开对该端口的访问。
注意到 location 的配置:
- root html; #根目录,相对于安装目录
- index index.html index.htm; #默认主页
默认,你把文件放在安装目录下的 html 文件夹,即可通过 Nginx 访问。
The End



大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)