Nginx 靜態(tài)服務(wù)器
靜態(tài)我這
生產(chǎn)環(huán)境是2臺(tái),我這測試就一臺(tái)。
動(dòng)靜分離:
Nginx_staticserver:192.168.121.128
nginx_server:192.168.121.133
靜態(tài)文件服務(wù)器配置:
root@192conf.d#catstatic.confserver{listen80default_server;#default_serverserver_name_;#ip訪問location/{root/data/company/;#靜態(tài)文件存放的目錄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服務(wù)器代理:
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主機(jī)頭proxy_set_headerX-Real-IP$remote_addr;proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for;}}
效果圖:
生產(chǎn)域名的話,在萬網(wǎng)做個(gè)解析就好了!
Tags:靜態(tài)我這,Nginx 靜態(tài)服務(wù)器
版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。