Reputation: 544
I have a front end Apache we server which only answers http requests. It acts as front end load balancers for many web application servers. Now I have a new webapplication which i want to host on https only. My Question is how do i redirect all https requests to my web application from apache server. Is it possible to do with mod_jk.
I do not want to setup https on front end web server.
Is it possible ??
My webapp is on glasshfish 3.1.2
Upvotes: 0
Views: 1108
Reputation: 529
If your front-end web server doesn't listen on HTTPS port (443) it can't forward the traffic targeting this port. The correct solution is to setup HTTPS on your front-end web server and forward the requests using mod_jk or mod_proxy_ajp. In a production environment you should always use the front-end web server because of security, performance and maintenance reasons.
To redirect users accessing port 80 (force them using HTTPS), you could use mod_rewrite directives in apache configuration as stated below. This also works if your GlassFish server listens directly on port 443 (HTTPS) without front-end web server.
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Upvotes: 1