美文网首页
harbor 加固 修改默认的前端路径

harbor 加固 修改默认的前端路径

作者: akka9 | 来源:发表于2025-01-04 15:34 被阅读0次

harbor默认前端路径为 / ,可以把它改为 其他路径。


    location / {
      proxy_pass http://portal/;
      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 $x_forwarded_proto;

      proxy_cookie_path / "/; HttpOnly; Secure";

      proxy_buffering off;
      proxy_request_buffering off;
    }

改为 :

    location /harbor {
      proxy_pass http://portal/;
      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 $x_forwarded_proto;

      proxy_cookie_path / "/; HttpOnly; Secure";

      proxy_buffering off;
      proxy_request_buffering off;
    }

    location / {
      rewrite /(.*\.css.*) https://$http_host:443/harbor/$1 permanent;
      rewrite /(.*\.js.*)  https://$http_host:443/harbor/$1 permanent;
      rewrite /(.*\.svg.*) https://$http_host:443/harbor/$1 permanent;
      #rewrite /(account.*) https://$http_host:443/harbor/$1 permanent;
    }



相关文章

网友评论

      本文标题:harbor 加固 修改默认的前端路径

      本文链接:https://www.haomeiwen.com/subject/mnzhyjtx.html