您的位置:首页 > 运维架构 > Nginx

[置顶] 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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: