Nginx+Tomcat7:The page you are looking for is temporarily unavailable.Please try again later.
来源:互联网 发布:哪件商品能在淘宝发布 编辑:程序博客网 时间:2024/06/03 16:32
问题原因:
在Linux上面部署Nginx+Tomcat负载均衡,两台服务器 一台部署Nginx另一台部署Tomcat运行程序,Tomcat服务器没问题但是linux就是代理不到
解决办法:
查找nginx.conf文件中proxy_pass转发的IP地址是否在本机上和nginx所在的服务器可以访问。
nginx.conf文件中upstream负载均衡配置是否正确
检查被代理的内网ip地址ifconfig
[root@iZ282a7t938Z bin]# ifconfigeth0 Link encap:Ethernet HWaddr 00:16:3E:02:31:4B inet addr:XXXXX Bcast:10.164.15.255 Mask:255.255.240.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:18945433 errors:0 dropped:0 overruns:0 frame:0 TX packets:156897 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:894522211 (853.0 MiB) TX bytes:11720806 (11.1 MiB) Interrupt:162 eth1 Link encap:Ethernet HWaddr 00:16:3E:02:33:0E inet addr:XXXXXX Bcast:121.42.47.255 Mask:255.255.252.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:541127214 errors:0 dropped:0 overruns:0 frame:0 TX packets:8424840 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:27250810048 (25.3 GiB) TX bytes:8234399240 (7.6 GiB) Interrupt:161 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:1352 errors:0 dropped:0 overruns:0 frame:0 TX packets:1352 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:73202 (71.4 KiB) TX bytes:73202 (71.4 KiB)
#设定负载均衡的服务器列表
upstream web{
#weigth参数表示权值,权值越高被分配到的几率越大
server XXXX1X:3128 weight=5;#本机上的Squid开启3128端口
server XXXX2x:80 weight=1;
server XXXX3x:80 weight=6;
}
worker_processes 1;events { worker_connections 1024;}http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; upstream web {server xxxxxx1:8080;ip_hash;} server { listen 80; server_name www.etz168.com etz168.com; location / { proxy_pass http://web;proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }}
如果不能访问,查看tomcat是否启动了、关闭tomcat时是否有异常、访问的端口是否开启、nginx所在的服务器不能访问外网、只能用内网IP等等。
解决以上问题后,把nginx.conf文件中proxy_pass更改成可以访问的IP地址+端口就ok了。
鲁承星/Luke
互联网产品负责人/Leader
-----------------------------------------------------
微信 : 465608188
电话:13717825876
邮箱:lcxingperfect@163.com
0 0
- Nginx+Tomcat7:The page you are looking for is temporarily unavailable.Please try again later.
- nginx +tomcat The page you are looking for is temporarily unavailable.Please try again later.
- The page you are looking for is temporarily unavailable.Please try again later.
- the page you are looking for is temporarily unavailable. Please try again later 解决方案
- php-cgi 9000端口被占用,nginx无法打开php页面(The page you are looking for is temporarily unavailable.Please try)
- 解决nginx的The page you are looking for is temporarily unavailable错误办法
- 解决nginx的The page you are looking for is temporarily unavailable错误办法
- 解决nginx的An error occurred. The page you are looking for is temporarily unavailable错误办法
- Nginx--Sorry, the page you are looking for is currently unavailable
- 服务器nginx配置问题the page you are looking for is currently unavailable
- NBU 巡检报错:You are already running availabe_media.try again later
- URAL1997-Those are not the droids you're looking for
- Those are not the droids you're looking for Gym
- PHP Official Account Services Unavailable, Try Again Later
- 使用fancybox,报如下错误:The requested content cannot be loaded. Please try again later.的解决方法
- An error was encountered. Please return to the previous page and try again.
- What are you looking for on top of the world? English readings.
- Ural 1997-Those are not the droids you're looking for 二分图匹配
- NavigationController嵌套一个UIViewController问题
- phpcms 循环输出
- cocos2dx 两个重叠按钮点击响应关系
- C++分割字符串
- Spring在代码中获取bean的几种方式
- Nginx+Tomcat7:The page you are looking for is temporarily unavailable.Please try again later.
- 数据库 外键与索引
- Linux串口驱动
- 应用 Valgrind 发现 Linux 程序的内存问题
- MVC大型商贸系统(库存管理)技术解释(五) 销售部门调整
- 某个数的阶乘尾部含有0的数
- WebLogic(12C)——Server
- 安卓颜色代码如何记忆
- Radiobutton样式