新闻动态

Nginx 静态服务器

发布日期:2018-08-11 18:27 | 文章来源:网络

静态我这

生产环境是2台,我这测试就一台。

动静分离:

Nginx_staticserver:192.168.121.128

nginx_server:192.168.121.133

静态文件服务器配置:

root@192conf.d#catstatic.confserver{listen80default_server;#default_serverserver_name_;#ip访问location/{root/data/company/;#静态文件存放的目录indexindex.htmlindex.htm;}}

#nginx_static映射的目录文件存放路径

root@192conf.d#ls/data/company/aboutUs.htmlimgmessageCloud.htmlnews-solution.htmlpriceCloud.htmlsolutionO2O.htmlbakindex.htmlmin-system.htmlnews-trends.htmlprivateCloud.htmltrackCloud.htmlcompanyWebsite-20170111.zipITservice.htmlnewDetail.htmloperationPerson.htmlsolutionB2B2C.htmlWMS.htmlcssjoinUS.htmlnewsoperationsCourse.htmlsolutionB2B.htmlfontsjsnews.htmloperationSystem.htmlsolutionB2C.html

nginx服务器代理:

root@localhostconf.d#catupstream.confupstreamcompany{server192.168.121.128:80;}root@localhostconf.d#catzabbix.test.confserver{listen80;server_name_;location/{indexindex.html;proxy_passcompany;#upstreamproxy_set_headerHost$host;#nginx主机头proxy_set_headerX-Real-IP$remote_addr;proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for;}}

效果图:

生产域名的话,在万网做个解析就好了!

Tags:静态我这,Nginx 静态服务器

版权声明:本站文章来源标注为YINGSOO的内容版权均为本站所有,欢迎引用、转载,请保持原文完整并注明来源及原文链接。禁止复制或仿造本网站,禁止在非www.yingsoo.com所属的服务器上建立镜像,否则将依法追究法律责任。本站部分内容来源于网友推荐、互联网收集整理而来,仅供学习参考,不代表本站立场,如有内容涉嫌侵权,请联系alex-e#qq.com处理。

相关文章

实时开通

自选配置、实时开通

免备案

全球线路精选!

全天候客户服务

7x24全年不间断在线

专属顾问服务

1对1客户咨询顾问

在线
客服

在线客服:7*24小时在线

客服
热线

400-630-3752
7*24小时客服服务热线

关注
微信

关注官方微信
顶部
请您留言

YINGSOO400-630-3752

提交