nginx+tomcat搞定域名访问

nginx+tomcat搞定域名访问

upstream flyingocean{
server localhost:8090; #这里是本地tomcat的ip和端口号
}
server{
listen 80;
server_name flyingocean.cn www.flyingocean.cn; #这…

这里写图片描述

upstream flyingocean{
server localhost:8090; #这里是本地tomcat的ip和端口号
}
server{
listen 80;
server_name flyingocean.cn www.flyingocean.cn; #这里是需要设置的域名
location / {
proxy_pass http://flyingocean; #这里是上面upstream设置的
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
# nginx

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×