一、点击登录后报错404.
nginx 8000端口 ,Tomcat8086端口。 nginx做反向代理到Tomcat。
ip:端口/OK_WCGLXT_MUSEUM/…
处理:看了日志后
nginx 注意斜杠,别少了。
nginx的后端路径要和这个同名
Tomcat下面的文件名, 注意要与nginx反代的 /OK_WCGLXT_MUSEUM一致。
nginx的后端路径要和这个同名
二、点击登录报错error:timeout of 5000ms exceeded at e.exports
error:timeout of 5000ms exceeded at e.exports
处理: 数据库jdbc配置问题导致的。
三、url中直接带callbackURL的重定向到https+域名
出现的情况为:
1、没有超时的情况,点击“微信导览”:https://www.gzzcbwg.com/ZCwechat/shiro/ZCLoging?token=5b0c1069291a7edd17b3a10c7cc45c0d直接这个地址
2、当超时掉线的时候,点“微信导览”连接的时候 才会出现 callbackURL连接https://www.gzzcbwg.com/zcmuseum/xuf/ufc/login.jsp?F=22766&callbackURL=http://10.10.0.57:8082/ZCwechat/shiro/ZCLoging(没清楚这拼接url为啥会这样)。
此时这个跳转页面,登录是登不上的 (由于后面的带参URI)
处理方法:在nginx.conf的http { }块内加入
if ( $query_string ~ “callbackURL=(.*)” )
{
return 301 https://www.gzzcbwg.com/zcmuseum;
}
里面nginx对应的“微信导览”的跳转配置。
参考:百度搜索“nginx url带参数跳转”里面的网页。
四、Windows上做nginx开机自启
用winsw让任何Windows程序都能运行为服务
参考:
https://www.jianshu.com/p/fc9e4ea61e13 用winsw让任何Windows程序都能运行为服务
https://www.wuwenhui.cn/4570.html Windows下Nginx的安装及开机启动
五、
内网IP访问正常。
公网该页面报错,缺失图片。
F12页面报错:
带https的url则报错ERR_SSL_PROTOCOL_ERROR
查看对应的前端代码:看样子是写死了。当过nginx后,由于规则,将http变成https了,导致报错。
原nginx配置:
处理方法:将nginx.conf原先的 /play代码段改成: (不用动前端html代码)
location /play/ {
proxy_pass http://172.16.20.74:8084;
client_max_body_size 1000m;
proxy_redirect off;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 600;
proxy_buffer_size 256k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
proxy_max_temp_file_size 128m;
proxy_cache_valid 200 302 60m;
proxy_cache_valid 404 1m;
}