主题 : jeecmsX2版本部署nginx代理
级别: 商业授权用户
UID: 140910
积分:130 加为好友
威望: 0 精华: 0
主题:14 回复:65
注册时间:2022-03-30
在线时长:0.67
1#   发表于:2023-12-05 20:13:26  IP:218.72.*.*
server {
        listen       80;
        server_name  192.168.0.232 www.tianyejieshui.cn;
        if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})") {
           set $year $1;
           set $month $2;
           set $day $3;
        }
        access_log logs/$year-$month-$day-TYJSsite-access.log;
        open_log_file_cache max=30;
        add_header X-Frame-Options SAMEORIGIN always;
        include allow_deny_ip.conf;

        location /static/ {
          root /data/jeecms/tpl/;
        }
        location /u/ {
          root /data/jeecms/res/;
        }
        location /server-front/ {
            index index.html index.jhtml;
            proxy_pass        http://127.0.0.1:8191;
            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  Strict-Transport-Security  "max-age=31536000; includeSubdomains; preload";
        }
        location /admin/ {
            root /opt/jeecms_x2/view/admin/;
            try_files $uri $uri/ @router;
            index index.html index.jhtml index.htm;
        }

        location @router {
            rewrite ^.*$ /index.html last;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
        location /server-admin/ {
            index index.html index.jhtml;
            proxy_pass        http://127.0.0.1:8191;
            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;
        }
        location   / {
           #静态资源缓存配置
            if ($request_filename ~* .*\.(?:js|css|vue)$)
            {
               expires      30d;
            } 
            if ($request_filename ~* .*\.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm)$)
             {
             expires      30d;
             }
             proxy_read_timeout 30;  # 秒 
             proxy_pass        http://127.0.0.1:8191/server-front/;
             #proxy_pass        http://127.0.0.1:8091;
             #root H:/tpl/site1/default;
        }
}


网页显示
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Tue Dec 05 20:12:05 CST 2023
There was an unexpected error (type=Not Found, status=404).
网站首页
http://120.71.4.179/

请协助排查问题
级别: 总版主
UID: 10736
积分:148366 加为好友
威望: 205 精华: 42
主题:287 回复:126119
注册时间:2010-09-08
在线时长:15.11
2#   发表于:2023-12-06 09:35:33  IP:183.223.*.*
 proxy_pass        http://127.0.0.1:8191/server-front/;  这个直接跳转到server-front端口试试先
路漫漫其修远兮,吾将上下而求索!
级别: 总版主
UID: 10736
积分:148366 加为好友
威望: 205 精华: 42
主题:287 回复:126119
注册时间:2010-09-08
在线时长:15.11
3#   发表于:2023-12-06 09:35:54  IP:183.223.*.*
 proxy_pass        http://127.0.0.1:18082 类似这样
路漫漫其修远兮,吾将上下而求索!
级别: 商业授权用户
UID: 140910
积分:130 加为好友
威望: 0 精华: 0
主题:14 回复:65
注册时间:2022-03-30
在线时长:0.67
4#   发表于:2023-12-06 13:36:48  IP:49.70.*.*
http://120.71.4.179:8191/server-front,也出不来
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Wed Dec 06 13:29:27 CST 2023
There was an unexpected error (type=Not Found, status=404).
级别: 总版主
UID: 10736
积分:148366 加为好友
威望: 205 精华: 42
主题:287 回复:126119
注册时间:2010-09-08
在线时长:15.11
5#   发表于:2023-12-06 13:59:55  IP:183.223.*.*
您把这个 / 代理到 http://120.71.4.179:18082  server-front的端口
路漫漫其修远兮,吾将上下而求索!
级别: 商业授权用户
UID: 140910
积分:130 加为好友
威望: 0 精华: 0
主题:14 回复:65
注册时间:2022-03-30
在线时长:0.67
6#   发表于:2023-12-06 17:51:12  IP:218.72.*.*
回复第5楼
能写具体一点吗?示列代码给一下。server-front没有开这个端口18082
http://120.71.4.179:18002
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Wed Dec 06 17:37:44 CST 2023
There was an unexpected error (type=Not Found, status=404).
级别: 总版主
UID: 10736
积分:148366 加为好友
威望: 205 精华: 42
主题:287 回复:126119
注册时间:2010-09-08
在线时长:15.11
7#   发表于:2023-12-06 17:57:16  IP:183.223.*.*
路漫漫其修远兮,吾将上下而求索!
级别: 商业授权用户
UID: 140910
积分:130 加为好友
威望: 0 精华: 0
主题:14 回复:65
注册时间:2022-03-30
在线时长:0.67
8#   发表于:2023-12-06 17:59:36  IP:218.72.*.*
2023/12/06 17:56:48 [crit] 1856#0: *202 open() "/usr/local/nginx/logs/2023-12-06-TYJSsite-access.log" failed (13: Permission denied) while logging request, client: 218.84.72.86, server: 192.168.0.232, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8191/server-front/", host: "120.71.4.179"

nginx日志,这块问题出在哪里?怎么修改
级别: 商业授权用户
UID: 140910
积分:130 加为好友
威望: 0 精华: 0
主题:14 回复:65
注册时间:2022-03-30
在线时长:0.67
9#   发表于:2023-12-06 18:15:15  IP:218.72.*.*
server-front,日志也没有报错啊
2023-12-06 18:03:49.994 [main] INFO  o.s.security.web.DefaultSecurityFilterChain - Will not secure Ant [pattern='/v2/api-docs']
2023-12-06 18:03:50.481 [main] WARN  o.s.b.a.freemarker.FreeMarkerAutoConfiguration - Cannot find template location(s): [classpath:/templates/] (please add some templates, check your FreeMarker configuration, or set spring.freemarker.check-template-location=false)
2023-12-06 18:03:50.957 [main] INFO  org.apache.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-18002"]
2023-12-06 18:03:50.975 [main] INFO  o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 18002 (http) with context path ''
2023-12-06 18:03:50.989 [main] INFO  c.a.cloud.nacos.registry.NacosServiceRegistry - nacos registry, demo server-front 192.168.0.232:18002 register finished
2023-12-06 18:03:50.993 [main] INFO  s.d.s.web.plugins.DocumentationPluginsBootstrapper - Context refreshed
2023-12-06 18:03:51.023 [main] INFO  s.d.s.web.plugins.DocumentationPluginsBootstrapper - Found 1 custom documentation plugin(s)
2023-12-06 18:03:51.085 [main] INFO  s.d.spring.web.scanners.ApiListingReferenceScanner - Scanning for api listing references
2023-12-06 18:03:51.393 [main] INFO  s.d.s.w.r.operation.CachingOperationNameGenerator - Generating unique operation named: commentSetUpUsingGET_1
2023-12-06 18:03:51.436 [main] INFO  s.d.s.w.r.operation.CachingOperationNameGenerator - Generating unique operation named: frontPageUsingGET_1
2023-12-06 18:03:51.506 [main] INFO  s.d.s.w.r.operation.CachingOperationNameGenerator - Generating unique operation named: downloadContentAnnexUsingGET_1
2023-12-06 18:03:51.571 [main] INFO  s.d.s.w.r.operation.CachingOperationNameGenerator - Generating unique operation named: queryPageUsingGET_1
2023-12-06 18:03:51.622 [main] INFO  s.d.s.w.r.operation.CachingOperationNameGenerator - Generating unique operation named: detailUsingGET_1
2023-12-06 18:03:51.649 [main] INFO  s.d.s.w.r.operation.CachingOperationNameGenerator - Generating unique operation named: listUsingGET_1
2023-12-06 18:03:51.681 [main] INFO  s.d.s.w.r.operation.CachingOperationNameGenerator - Generating unique operation named: listUsingGET_2
2023-12-06 18:03:51.687 [main] INFO  s.d.s.w.r.operation.CachingOperationNameGenerator - Generating unique operation named: channelUsingGET_1
2023-12-06 18:03:51.689 [main] INFO  s.d.s.w.r.operation.CachingOperationNameGenerator - Generating unique operation named: channelUsingGET_2
2023-12-06 18:03:51.690 [main] INFO  s.d.s.w.r.operation.CachingOperationNameGenerator - Generating unique operation named: channelUsingGET_3
2023-12-06 18:03:51.693 [main] INFO  s.d.s.w.r.operation.CachingOperationNameGenerator - Generating unique operation named: contentUsingGET_1
2023-12-06 18:03:51.695 [main] INFO  s.d.s.w.r.operation.CachingOperationNameGenerator - Generating unique operation named: contentUsingGET_2
2023-12-06 18:03:51.696 [main] INFO  s.d.s.w.r.operation.CachingOperationNameGenerator - Generating unique operation named: contentUsingGET_3
2023-12-06 18:03:51.700 [main] INFO  s.d.s.w.r.operation.CachingOperationNameGenerator - Generating unique operation named: indexUsingGET_1
2023-12-06 18:03:51.702 [main] INFO  s.d.s.w.r.operation.CachingOperationNameGenerator - Generating unique operation named: topicTplUsingGET_1
2023-12-06 18:03:51.727 [main] INFO  s.d.s.w.r.operation.CachingOperationNameGenerator - Generating unique operation named: pageUsingGET_1
2023-12-06 18:03:51.732 [main] INFO  s.d.s.w.r.operation.CachingOperationNameGenerator - Generating unique operation named: listUsingGET_3
2023-12-06 18:03:51.745 [main] INFO  s.d.s.w.r.operation.CachingOperationNameGenerator - Generating unique operation named: listUsingGET_4
2023-12-06 18:03:51.778 [main] INFO  s.d.s.w.r.operation.CachingOperationNameGenerator - Generating unique operation named: pageUsingGET_2
2023-12-06 18:03:51.817 [main] INFO  com.jeecms.JeecmsServerFrontAppliction - Started JeecmsServerFrontAppliction in 33.391 seconds (JVM running for 35.801)
2023-12-06 18:04:28.498 [http-nio-18002-exec-1] INFO  o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet'
2023-12-06 18:04:28.498 [http-nio-18002-exec-1] INFO  org.springframework.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
2023-12-06 18:04:28.501 [http-nio-18002-exec-1] INFO  org.springframework.web.servlet.DispatcherServlet - Completed initialization in 2 ms

配置文件application,prod,redis3个也没有设置模板文件的配置,是这个问题吗?

级别: 商业授权用户
UID: 140910
积分:130 加为好友
威望: 0 精华: 0
主题:14 回复:65
注册时间:2022-03-30
在线时长:0.67
10#   发表于:2023-12-06 18:21:19  IP:218.72.*.*
配置文件application,prod,redis 设置模板文件的配置,配置错了。现在白屏,如何处置?

1 2 > >| 共2页