Derzeit nutzen wir einen Internet-Cloud-Anbieter, um unsere SaaS-Plattform zu hosten. Die Plattform besteht aus einem Firewall -> Cloud Provider SLB -> -> Apache Web Server -> HAPROXY SLB -> Liferay Platform
Wir mussten HAPROXY aufgrund eines Problems mit den Cloud-Anbietern SLB verwenden, das bedeutete, dass wir es nicht für den Lastausgleich der Liferay-Plattformanwendungen verwenden konnten.
Ich habe HAPROXY in unserer sicheren Schicht implementiert, und dies scheint den Trick des Lastausgleichs der Anforderungen ziemlich angemessen zu erfüllen.
Beim Testen kam es jedoch zu einem funktionalen Problem, bei dem die Auswahl eines Untermenüs aus dem Webportal dazu führte, dass die Anwendung hängen blieb. Bei Verwendung eines http-Analysators stellten wir fest, dass die Anforderung, die an den Browser des Benutzers zurückgeleitet wurde, in http war Bei dem Softwareanbieter stellt sich heraus, dass die Liferay-Anwendung einige hartcodierte http-Links hat, und dass andere Kunden dies umgehen, indem sie physische NLBs wie F5 verwenden und den http-Verkehr auf https umleiten.
Der Eintrag in den HAPROXY-Protokollen lautet:
haproxy[2717]: haproxy[2717]: <Apache Web Agent>:37957 [11/Apr/2013:08:07:00.128] http-uapi uapi/<ServerName> 0/0/0/9/10 200 4912 - - ---- 4/2/1/2/0 0/0 "GET/servicedesk/controller?docommand=renderradform&!key=esd_sfb001_frm_feedback_forms_list&isportalintegratedmode=true&USR=joe.bloggs%40gmail.com&_dc=1365667773097&redirecturl=controller%3Fdocommand%3Drenderbody%26%21key%3DESD_SFB001_FRM_FEEDBACK_FORMS_LIST%26isportalintegratedmode%3Dtrue&sso_token=ALiYv2UqzLsAhSw1ZchRDlCHlq44Bhj9&ONERROR=%2Fweb%2Fjsp%2Fapps%2Fportal-integration-error.jsp&itype=login&slicetoken=NW51O%242aRo%2C_Zz%2476P_9DTtnFmz6%28bhk&AUTOFORWARDURL=controller%3Fdocommand%3Drenderbody%26%21key%3DESD_SFB001_FRM_FEEDBACK_FORMS_LIST%26isportalintegratedmode%3Dtrue&LOGINPAGE=https%3A%2F%2F<FQDN of Web Portal>%2Fweb%2F4732cf01-82c3-4bc5-b6c9-552253e672cf%2Fworkflow-tools&appid=1&!uid=1&!redownloadToken=7.0.3.1.1363611301.0&userlocale=en_US&!datechanged=2012-05-18%2015:05:31.38 HTTP/1.1"
:37957 [11/Apr/2013:08:07:00.128] http-uapi uapi/<ServerName> 0/0/0/9/10 200 4912 - - ---- 4/2/1/2/0 0/0 "GET/servicedesk/controller?docommand=renderradform&!key=esd_sfb001_frm_feedback_forms_list&isportalintegratedmode=true&USR=joe.bloggs%40gmail.com&_dc=1365667773097&redirecturl=controller%3Fdocommand%3Drenderbody%26%21key%3DESD_SFB001_FRM_FEEDBACK_FORMS_LIST%26isportalintegratedmode%3Dtrue&sso_token=ALiYv2UqzLsAhSw1ZchRDlCHlq44Bhj9&ONERROR=%2Fweb%2Fjsp%2Fapps%2Fportal-integration-error.jsp&itype=login&slicetoken=NW51O%242aRo%2C_Zz%2476P_9DTtnFmz6%28bhk&AUTOFORWARDURL=controller%3Fdocommand%3Drenderbody%26%21key%3DESD_SFB001_FRM_FEEDBACK_FORMS_LIST%26isportalintegratedmode%3Dtrue&LOGINPAGE=https%3A%2F%2F<FQDN of Web Portal>%2Fweb%2F4732cf01-82c3-4bc5-b6c9-552253e672cf%2Fworkflow-tools&appid=1&!uid=1&!redownloadToken=7.0.3.1.1363611301.0&userlocale=en_US&!datechanged=2012-05-18%2015:05:31.38 HTTP/1.1"
Der entsprechende HTTP-Browsereintrag zeigt:
http://<FQDN of ServiceDesk>/servicedesk/controller?docommand=renderradform&!key=esd_org019_frm_contact_list&isportalintegratedmode=true&USR=joe.bloggs%40gmail.com&_dc=1365665987887&redirecturl=controller%3Fdocommand%3Drenderbody%26%21key%3DESD_ORG019_FRM_CONTACT_LIST%26isportalintegratedmode%3Dtrue&sso_token=3NxsXYORMPp32SwL8ftVUCMH2QdWLH82&ONERROR=%2Fweb%2Fjsp%2Fapps%2Fportal-integration-error.jsp&itype=login&slicetoken=NW51O%242aRo%2C_Zz%2476P_9DTtnFmz6%28bhk&AUTOFORWARDURL=controller%3Fdocommand%3Drenderbody%26%21key%3DESD_ORG019_FRM_CONTACT_LIST%26isportalintegratedmode%3Dtrue&LOGINPAGE=https%3A%2F%2F<FQDN of Web Portal>>%2Fweb%2F4732cf01-82c3-4bc5-b6c9-552253e672cf%2Fapplication-setup&appid=1&!uid=1&!redownloadToken=7.0.3.1.1363611301.0&userlocale=en_US&!datechanged=2012-10-26%2019:00:25.08
Beim Lesen der Foren und anderer Websites sieht es so aus, als müssten wir HAPROXY verwenden, um den Verkehr zu https umzuleiten, aber ich versuche, ich kann es nicht zum Laufen bringen.
Dies ist unsere HAPROXY-Konfiguration:
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
stats socket/var/lib/haproxy/stats
defaults
mode http
log global
option httplog
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
frontend http-openfire
bind *:7070
default_backend openfire
backend openfire
balance roundrobin
server <serverName> <IPv4 Address>:7070 check
server <serverName> <IPv4 Address>:7070 check
frontend http-uapi
bind *:7080
default_backend uapi
backend uapi
balance roundrobin
server <serverName> <IPv4 Address>:7080 check
server <serverName> <IPv4 Address>:7080 check
frontend http-sec
bind *:8080
default_backend sec
backend sec
balance roundrobin
server <serverName> <IPv4 Address>:8080 check
server <serverName> <IPv4 Address>:8080 check
frontend http-wall
bind *:9080
default_backend wall
backend wall
balance roundrobin
server <serverName> <IPv4 Address>:9080 check
server <serverName> <IPv4 Address>:9080 check
frontend http-xmpp
bind *:9090
default_backend xmpp
backend xmpp
balance roundrobin
server <serverName> <IPv4 Address>:9090 check
server <serverName> <IPv4 Address>:9090 check
frontend http-aim
bind *:10080
default_backend aim
backend aim
balance roundrobin
server <serverName> <IPv4 Address>:10080 check
server <serverName> <IPv4 Address>:10080 check
frontend http-servicedesk
bind *:8081
default_backend servicedesk
backend servicedesk
balance roundrobin
server <serverName> <IPv4 Address>:8081 check
server <serverName> <IPv4 Address>:8081 check
listen stats :1936
mode http
stats enable
stats hide-version
stats realm Haproxy\ Statistics
stats uri/
stats auth haproxy:<Password>
Ich habe versucht, den Artikeln zu folgen, die unter https://stackoverflow.com/questions/13227544/haproxy-redirecting-http-to-https-ssl und http://parsnips aufgeführt sind .net/haproxy-http-to-https-redirect/, aber das hat keinen Unterschied gemacht.
Bin ich damit auf dem richtigen Weg oder versuchen wir, das Unmögliche zu erreichen? Ich hoffe, ich bin nur ein Idiot und einer von euch guten Leuten kann mich in die richtige Richtung weisen.
Siehe meine Antwort in diesem Thread:
Der Apache SSL-Reverseproxy unterbricht die Liferay-Authentifizierung
wenn Sie Liferay-Hardcoding http "korrigieren" möchten.