[置顶] nginx 访问静态html 方式
2015-12-22 15:34
447 查看
例子1:
# Dapeng School Configuration.
upstream www.dapengjiaoyu.cn {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name www.dapengjiaoyu.cn;
index index.html index.htm;
charset utf-8;
client_max_body_size 1000m;
#expires 24h;
location / {
root /home/workspace/dapeng/src/main/webapp/pagezhuangti/;
index jiuye.html;
}
# deny access hidden files.
location ~ /\. { deny all; access_log off; log_not_found off; }
}
例子2:
# Dapeng School Configuration.
upstream www.dapengedu.cn {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name www.dapengedu.cn;
index 2016sheji.html;
charset utf-8;
client_max_body_size 1000m;
#expires 24h;
location / {
root /home/workspace/dapeng/src/main/webapp/pagezhuangti/;
index 2016sheji.html;
}
}
两个例子应该可以合并写成一个配置文件的,
根据域名的不同,访问不同的目录,小编没研究过0_0
# Dapeng School Configuration.
upstream www.dapengjiaoyu.cn {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name www.dapengjiaoyu.cn;
index index.html index.htm;
charset utf-8;
client_max_body_size 1000m;
#expires 24h;
location / {
root /home/workspace/dapeng/src/main/webapp/pagezhuangti/;
index jiuye.html;
}
# deny access hidden files.
location ~ /\. { deny all; access_log off; log_not_found off; }
}
例子2:
# Dapeng School Configuration.
upstream www.dapengedu.cn {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name www.dapengedu.cn;
index 2016sheji.html;
charset utf-8;
client_max_body_size 1000m;
#expires 24h;
location / {
root /home/workspace/dapeng/src/main/webapp/pagezhuangti/;
index 2016sheji.html;
}
}
两个例子应该可以合并写成一个配置文件的,
根据域名的不同,访问不同的目录,小编没研究过0_0
相关文章推荐
- nginx Thinkphp rewrite
- Nginx配置文件nginx.conf中文详解
- Centos中升级nginx
- 终结者:具体解释Nginx(一)
- Nginx安全配置研究
- nginx服务器安装及配置文件详解
- linux 下安装 nginx
- “惊群”,看看nginx是怎么解决它的
- nginx核心进程模型
- 解决nginx reload失败
- Linux Is Not Matrix——Nginx安装
- nginx启动、重启、关闭
- 【Nginx】转:Nginx try_files
- 基于nginx的api网关
- Linux系统中设置多版本PHP共存配合Nginx服务器使用
- 在Mac OS上搭建Nginx+PHP+MySQL开发环境的教程
- Ubuntu Nginx安装
- Nginx配置文件详解
- nginx-日志切割脚本
- Linux下从零开始安装配置Nginx服务器+PHP开发环境