0

Dears, I have JSP application sitting on Apache tomcat. I have installed apache2.4 and enabled SSL with mod_jk and kerberos basic authentication working very well when i go to: https://mysite/App with user/password pop working fine.

However I want to redirect http://mysite/APP to use https instead.

I have SSL installed on both httpd ssl conf and on apache tomcat (8443)

I have http port 80,443 opened in apache and I also have 8443 opened on apache tomcat.

but everytime i go to http://mysite/APP i get this error: Bad Request Your browser sent a request that this server could not understand. Reason: You're speaking plain HTTP to an SSL-enabled server port. Instead use the HTTPS scheme to access this URL, please.

is there a way to redirect http to https apache because http apache is handling kerberos authentication.

SAAD3000
  • 1
  • 1
  • I managed to partially solve the problem by adding virtual host to 80 and 443 and now http is redirecting to https. However when adding /APP at the end of URL it prompts for basic authentication but does not redirect to AJP tomcat. It gives error:Not Found The requested URL / on the server. Looks like it does not pick the include worker properties in the httpd.conf file. And not allowed to add it inside virtualhost. Any ideas? – SAAD3000 Nov 23 '19 at 09:49
  • Redirect to https worked by adding the following lines inside virtual host 80 RewriteEngine on RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R=301,L] – SAAD3000 Nov 23 '19 at 09:53
  • I added the following lines to httpd.conf without virtual host and still back to squre 0 receiving 400 Bad request on http://mysite/ and it redirects to tomcat - ----- RewriteEngine on RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R=301,L] – SAAD3000 Nov 23 '19 at 10:30

0 Answers0