How to get the HttpHeaders information from Mod-Cluster with AJP connector for JBossAS 7?
adheep Oct 29, 2012 4:20 AMHi,
I've configured Mod-Cluster with AJP connector for the JBossAS 7. Before I was using the HTTP connector(default)
After this configuration I'm unable to get the information which I use to get using the "javax.ws.rs.core.HttpHeaders" in the Webservice class like the "X-Forwarded-For" and "X-Forwarded-Host"
httpd.conf
<IfModule manager_module> Listen 192.168.5.157:6666 <Location /mod_cluster-manager> SetHandler mod_cluster-manager Order deny,allow Deny from all Allow from 192.168.5. </Location> <VirtualHost 192.168.5.157:6666> ManagerBalancerName other-server-group ServerName 192.168.5.157 <Location /> Order deny,allow Allow from all </Location> LogLevel debug KeepAliveTimeout 300 MaxKeepAliveRequests 0 EnableMCPMReceive AllowDisplay On #RequestHeader set SSL_CLIENT_CERT "%s" #RequestHeader set SSL_CIPHER "%s" #RequestHeader set SSL_SESSION_ID "%s" #RequestHeader set SSL_CIPHER_USEKEYSIZE "%s" </VirtualHost> </IfModule> ########HTTPS Vhost Configuration############ <VirtualHost 192.168.5.157:443> ServerName 192.168.5.157 ErrorLog "logs/cluster_log" LogLevel debug RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} SSLEngine on SSLCertificateFile D:\Apache2.2\certs\Sample_Https.crt SSLCertificateKeyFile D:\Apache2.2\certs\Sample_Https_new.key #SSLProxyEngine On #SSLProxyVerify none #SSLProxyCACertificateFile D:\Apache2.2\certs\Sample.net.crt SSLOptions +ExportCertData RequestHeader set X-Forwarded-Proto "https" #RewriteRule ^(.*) - [E=CLIENT_IP:%{REMOTE_ADDR},L] #RequestHeader set x-forwarded-for %{CLIENT_IP}e <Location /> Order deny,allow Allow from All </Location> </VirtualHost> #####HTTP Vhost Configuration####### <VirtualHost 192.168.5.157:80> #ServerName 192.168.5.157 ServerName SamplePc.com ErrorLog "logs/cluster_log" LogLevel debug RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} #RewriteRule ^(.*) - [E=CLIENT_IP:%{REMOTE_ADDR},L] #RequestHeader set x-forwarded-for %{CLIENT_IP}e #RequestHeader set SSL_CLIENT_CERT "%s" #RequestHeader set SSL_CIPHER "%s" #RequestHeader set SSL_SESSION_ID "%s" #RequestHeader set SSL_CIPHER_USEKEYSIZE "%s" RequestHeader set X-Forwarded-Proto "https" #RequestHeader set X-Forwarded-For "" <Location /> Order deny,allow Allow from All </Location> </VirtualHost>
domain.xml
<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" instance-id="${jboss.node.name}" native="false"> <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/> <connector name="ajp" protocol="AJP/1.3" scheme="http" socket-binding="ajp"/> <virtual-server name="default-host" enable-welcome-root="false"> <alias name="localhost"/> <alias name="example.com"/> </virtual-server> </subsystem>
My guess is that the Mod-Cluster is not forwarding the client information to the JBoss? Is there anything that I'm missing or any configuration that I need to follow?