关注JEECG发展历程 关注最新动态和版本, 记录JEECG成长点滴 更新日志 - 技术支持 - 招聘英才

JEECG最新版本下载 JEECG智能开发平台 - 显著提高开发效率 常见问题 - 入门视频 - 参与开源团队

商务QQ: 69893005、3102411850 商务热线(5*8小时): 010-64808099 官方邮箱: jeecgos@163.com

查看: 6446|回复: 0

求助前端部署nginx后无法看到登录页问题--已解决

[复制链接]
发表于 2019-10-10 11:24:01 | 显示全部楼层 |阅读模式
本帖最后由 lycplayer 于 2019-10-10 11:56 编辑

我按照文档http://doc.jeecg.com/1273923 一步步做下来,后端war包部署在tomcat中,浏览器访问http://ip_address:port//jeecg-boot/jeecg-boot-module-system-2.1.0
能正常看到
Whitelabel Error PageThis application has no explicit mapping for /error, so you are seeing this as a fallback.
Thu Oct 10 11:17:29 CST 2019
There was an unexpected error (type=Internal Server Error, status=500).
org.apache.shiro.authc.AuthenticationException: Token????????

----------------------------------------------------------------
1,按照文档中所说将dist文件夹下的静态文件放入/usr/share/nginx/html
[root@izwz95mlpiydgvbzl33d4zz html]# pwd
/usr/share/nginx/html
[root@izwz95mlpiydgvbzl33d4zz html]# ll
total 392
-rw-r--r-- 1 root root   3650 May 10 16:08 404.html
-rw-r--r-- 1 root root   3693 May 10 16:08 50x.html
-rw-r--r-- 1 root root  80189 Oct 10 10:49 avatar2.jpg
-rw-r--r-- 1 root root 238852 Oct 10 10:49 color.less
drwxr-xr-x 2 root root   4096 Oct  9 16:55 css
drwxr-xr-x 2 root root   4096 Oct 10 10:41 dist
-rw-r--r-- 1 root root   1105 Oct 10 10:49 goright.png
drwxr-xr-x 2 root root   4096 Oct  9 16:55 img
-rw-r--r-- 1 root root   8581 Oct 10 10:49 index.html
drwxr-xr-x 2 root root   4096 Oct  9 16:55 js
-rw-r--r-- 1 root root   8929 Oct 10 10:49 logo.png
-rw-r--r-- 1 root root    368 May 10 16:08 nginx-logo.png
-rw-r--r-- 1 root root   2811 May 10 16:08 poweredby.png
drwxr-xr-x 4 root root   4096 Oct  9 16:55 tinymce
-rw-r--r-- 1 root root   9302 Oct 10 10:49 v2.js

2,在/etc/nginx/nginx.conf中增加
server {
                listen       80;
                server_name  ip_address;

                #后台服务配置,配置了这个location便可以通过http://域名/jeecg-boot/xxxx 访问
                location ^~ /jeecg-boot {
                        proxy_pass              http://127.0.0.1:8060/jeecg-boot/jeecg-boot-module-system-2.1.0;
                        proxy_set_header        Host 127.0.0.1;
                        proxy_set_header        X-Real-IP $remote_addr;
                        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
                }
                #解决Router(mode: 'history')模式下,刷新路由地址不能找到页面的问题
                location / {
                        root   html;
                        index  index.html index.htm;
                        if (!-e $request_filename) {
                                rewrite ^(.*)$ /index.html?s=$1 last;
                                break;
                        }
                }
        }
3,浏览器访问http://ip_address/jeecg-boot 仍然看到的是
Whitelabel Error Page
无法看到登录页面,这是哪里没配置好呢?

找到原因了,必须以域名方式访问!













您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表