session - 如何设置 haproxy 会话和静态页面?
问题描述
我有这两个问题:
HAProxy 会话
通过负载均衡器登录 Jira/Confluence 的管理员管理页面,无法登录。如果登录到每个服务器,它可以登录到管理员管理页面。
HAProxy 静态页面
Jira 负载均衡器 IP 无法显示常规 CSS 页面。但如果访问不同的服务器,它们会很好。所以原因将是HAProxy中关于静态的配置。
添加/etc/haproxy/haproxy.cfg
#---------------------------------------------------------------------
# main frontend which proxys to the backends
#---------------------------------------------------------------------
frontend jira
bind :::8080 v4v6
# acl url_static path_beg -i /static /images /javascript /stylesheets
# acl url_static path_end -i .jpg .gif .png .css .js
# use_backend static if url_static
default_backend jira
frontend confluence
bind :::8090 v4v6
# acl url_static path_beg -i /static /images /javascript /stylesheets
# acl url_static path_end -i .jpg .gif .png .css .js
# use_backend static if url_static
default_backend confluence
#---------------------------------------------------------------------
# static backend for serving up images, stylesheets and such
#---------------------------------------------------------------------
# backend static
# balance roundrobin
# server static 127.0.0.1:4331 check
#---------------------------------------------------------------------
# round robin balancing between the various backends
#---------------------------------------------------------------------
backend jira
balance roundrobin
cookie JSESSIONID prefix nocache
server jira1 [IP1]:8080 check cookie jira1
server jira2 [IP2]:8080 check cookie jira2
backend confluence
balance roundrobin
cookie JSESSIONID prefix nocache
server confluence1 [IP3]:8090 check cookie confluence1
server confluence2 [IP4]:8090 check cookie confluence2
解决方案
推荐阅读
- cryptojs - TripleDES .Net 到 TripleDES (crypto-js) Javascript
- protractor - 在 chrome 中悬停后无法单击元素
- sql-server - 当 2 列的数据匹配时选择记录
- jquery - 我只想使用 jquery 打开弹出窗口三次
- java - 如何从单独的类中获取用户输入
- arrays - 当我尝试在我的 EA 中构建指标(RSI 线的 SMA)时出现“数组超出范围”
- javascript - 未捕获的引用错误:
没有定义 - sql - 使用“或”连接单个表中的两列太慢
- android - 如何从 Android 虚拟机获取 .ab 备份文件或设备映像?
- ios - 无法将图像分享到 Facebook 和 Messenger