nginx 代理 访问 solo JS CSS 404 问题

本贴最后更新于 244 天前,其中的信息可能已经时移世改

求教各位大神········

4 回帖
请输入回帖内容...
  • 88250

    信息有点少,没法给出有效的帮助哦。

    1 回复
  • dinglevin

    点击登录“登录黑客派社区账号后即可开始使用”时出现 404 错误

    Nginx 配置:

        location / {
            proxy_pass http://blog.server$request_uri;
    
            proxy_http_version 1.1;
            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;
            proxy_set_header X-Forwarded-Proto https;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;
            client_max_body_size  10m;
        }
    
    1 回复
  • 88250

    看下日志应该能找到问题。

  • dinglevin

    找到问题了,应该是 nginx 方向代理了两台 solo 服务,session/cookies 不共享引起的,不过啥解决方案不?

    错误日志:

    [ERROR]-[2020-03-31 22:34:46]-[org.b3log.solo.util.Skins:108]: Gets console template [error/400.ftl] failed
    freemarker.template.TemplateNotFoundException: Template not found for name "error/400.ftl".
    The name was interpreted by this TemplateLoader: FileTemplateLoader(baseDir="/opt/solo", canonicalBasePath="/opt/solo/").
    	at freemarker.template.Configuration.getTemplate(Configuration.java:2845) ~[freemarker-2.3.29.jar:2.3.29]
    	at freemarker.template.Configuration.getTemplate(Configuration.java:2647) ~[freemarker-2.3.29.jar:2.3.29]
    	at org.b3log.solo.util.Skins.getTemplate(Skins.java:106) [solo/:?]
    	at org.b3log.solo.processor.SkinRenderer.getTemplate(SkinRenderer.java:64) [solo/:?]
    	at org.b3log.latke.http.renderer.AbstractFreeMarkerRenderer.render(AbstractFreeMarkerRenderer.java:88) [latke-core-3.2.15.jar:?]
    
    1 操作
    dinglevin 在 2020-03-31 23:12:13 更新了该回帖