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

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;
    }



最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容