Proxy Pass über ajp funktioniert nicht für Hash-URLs

1445
Fircx

Ich habe Apache vor Jboss, der an 80 Port arbeitet, und Jboss hört auf 8080. Apache leitet jede Anfrage an Jboss weiter. So ist sein ruhiges Standardszenario nichts Besonderes. . .

Meine erste Aufgabe bestand darin, eine echte IP in JBoss Log zu protokollieren. (Coz Ich habe einen Proxy innerhalb des Apache-Servers und schreibe die Engine um.)

<VirtualHost *:80> ServerName test.com ServerAlias test.com CustomLog /var/log/httpd/access.log combined  RewriteEngine on RewriteLogLevel 5 RewriteLog "/var/log/httpd/rewrite.log" RewriteRule ^/test.txt$ /someurl/search.cgi?iHash=somehash [P] RewriteRule ^/test2$ /just/static/url/ [P] ProxyRequests off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://test.com:8080/ ProxyPassReverse / http://test.com:8080/ 

Also habe ich dieses Problem mit ajp gelöst:

<Location /test2> ProxyPass ajp://localhost:8009/just/static/url/ ProxyPassReverse ajp://localhost:8009/just/static/url/ </Location> 

Aber jetzt ist das Problem, dass es nur für statische URLs nicht mit Hash-URLs funktioniert. Das Problem ist, dass Apache irgendwie URL umleitet, aber ich erhalte den HTTP Status 404-Fehler von Jboss. Vielleicht hatte jemand das gleiche Problem oder wusste die Lösung. :)

0

1 Antwort auf die Frage

0
Angel

Sie können mod_jk mit ajp verwenden.

Konfigurieren Sie zunächst Jboss für die Zusammenarbeit mit mod_jk. Beispiel: jboss + jk

Ich nehme an, ich schätze, dass die Anschlusseinstellungen auf 8009 festgelegt sind. Sie können Ihren Apache mit mod_jk und ajp für die Umleitung konfigurieren. Und mounten Sie Ihre URL mit:

<IfModule mod_jk.c> # a list of Server instances JkWorkerProperty worker.list=JBossA # connection properties to instance A on localhost JkWorkerProperty worker.tomcatA.type=ajp13 JkWorkerProperty worker.tomcatA.host=localhost JkWorkerProperty worker.tomcatA.port=8009 # some other configuration JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories # forwarding URL prefixes to Server instances JkMount /APPUrl/* JbossA </IfModule> 

und worker.properties mit:

worker.list=jk-status worker.jk-status.type=status worker.jk-status.read_only=true worker.list=jk-manager worker.jk-manager.type=status worker.list=jk-status worker.jk-status.type=status worker.jk-status.read_only=true worker.list=jk-manager worker.jk-manager.type=status worker.balancer.error_escalation_time=0 worker.balancer.max_reply_timeouts=10 worker.balancer.balance_workers=node1 worker.node1.reference=worker.template worker.node1.host=localhost worker.node1.port=8109 worker.node1.activation=A worker.balancer.balance_workers=node2 worker.node2.reference=worker.template worker.node2.host=localhost worker.node2.port=8209 worker.node2.activation=A worker.template.type=ajp13 worker.template.socket_connect_timeout=5000 worker.template.socket_keepalive=true worker.template.ping_mode=A worker.template.ping_timeout=10000 worker.template.connection_pool_minsize=0 worker.template.connection_pool_timeout=600 worker.template.reply_timeout=300000 worker.template.recovery_options=3 worker.list=ajp13 worker.ajp13.port=8009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 worker.ajp13.lbfactor=1