Skip to content

更新 WebUI 后面板内容未更新 #2711

Description

@LarchArc

前提:

之前使用时注意到,面板更新内容后,如果通过域名访问面板,那么面板显示的是旧的内容,但是从 IP+端口 访问就是新的内容。

后面排查是 Nginx 配置上的问题。
例如一般可能的反向代理配置是:

    location / {
        proxy_pass http://127.0.0.1:6185;
        proxy_set_header Host 127.0.0.1:$server_port;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header REMOTE-HOST $remote_addr;
        add_header X-Cache $upstream_cache_status;
        proxy_set_header X-Host $host:$server_port;
        proxy_set_header X-Scheme $scheme;
        proxy_connect_timeout 30s;
        proxy_read_timeout 86400s;
        proxy_send_timeout 30s;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

可以由此解决问题:

    location = /index.html {
        proxy_pass http://127.0.0.1:6185;
        proxy_set_header Host $host;
        add_header Cache-Control "no-store, no-cache, must-revalidate" always;
        add_header Surrogate-Control "no-store" always;
        add_header Pragma "no-cache" always;
        add_header Expires "0" always;
        proxy_no_cache 1;
        proxy_cache_bypass 1;
    }
    
    location /assets/ {
        proxy_pass http://127.0.0.1:6185;
        proxy_set_header Host $host;
        expires 1y;
        add_header Cache-Control "public, max-age=31536000, immutable" always;
    }
    
    location / {
        proxy_pass http://127.0.0.1:6185;
        proxy_set_header Host $host;
        add_header Cache-Control "no-store, no-cache, must-revalidate" always;
        add_header Surrogate-Control "no-store" always;
        add_header Pragma "no-cache" always;
        add_header Expires "0" always;
        proxy_no_cache 1;
        proxy_cache_bypass 1;
    }

更新配置后,等待几分钟刷新页面(可以强制刷新: Ctrl + F5 )就好了

Activity

  1. locked and limited conversation to collaborators on Sep 11, 2025
  2. converted this issue into a discussion #2713 on Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions