您的位置 首页 制造

Nginx动静态别离

worker_processes8;events {use epoll;worker_connections1024;}http {includemime.types;default_typeappl

worker_processes8;

events {

use epoll;

worker_connections1024;

}

http {

includemime.types;

default_typeapplication/octet-stream;

sendfileon;

keepalive_timeout65;

gzipon;

upstream tomcats{

server 127.0.0.1:8080;}

server {

listen80 default_server;

server_nametest.tiao.xxx.com;

#拜访/ROOT/下的static中的静态文件

location ^~ /static/{

root/usr/local/tomcat/webapps/ROOT/;

}

location / {

#动态程序丢给后端tomcat处理方

proxy_passhttp://tomcats;

}

error_page500 502 503 504/50x.html;

location = /50x.html {

roothtml;

}

}

#网站静态资源交给后端CDN处理

server {

listen80;

server_name static.test.tiao.xxx.com;

location / {

root/usr/local/tomcat/webapps/ROOT/static/;

}

error_page500 502 503 504/50x.html;

location = /50x.html {

roothtml;

}

}

}

声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/bandaoti/zhizao/322877.html

为您推荐

联系我们

联系我们

在线咨询: QQ交谈

邮箱: kf@86ic.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

返回顶部