Skip to main content
added 4 characters in body
Source Link

I have two web applications running under tomcat 7.0

  1. https:// secure.example.com:8443
  2. http:// insecure.example.com:8080

They have two separate "host" records in server.xml (different domains, separate locations).

I need first one to be available via HTTPS only. In other words I need insecure requests to secure application to be redirected to secure port. But insecure application still must be available via HTTP.I need first one to be available via HTTPS only. In other words I need insecure requests to secure application to be redirected to secure port. But insecure application still must be available via HTTP.

  • http:// insecure.example.com:8080 - OK
  • https:// secure.example.com:8443 - OK
  • http:// secure.example.com:8080 --> https:// secure.example.com:8443

I know it is possible to specify "redirectPort" in insecure Connector (server.xml) but then HTTP requests to any of the applications(domains) will be redirected to secure port.

Is it possible to configure that with single tomcat instance?

I have two web applications running under tomcat 7.0

  1. https:// secure.example.com:8443
  2. http:// insecure.example.com:8080

They have two separate "host" records in server.xml (different domains, separate locations).

I need first one to be available via HTTPS only. In other words I need insecure requests to secure application to be redirected to secure port. But insecure application still must be available via HTTP.

  • http:// insecure.example.com:8080 - OK
  • https:// secure.example.com:8443 - OK
  • http:// secure.example.com:8080 --> https:// secure.example.com:8443

I know it is possible to specify "redirectPort" in insecure Connector (server.xml) but then HTTP requests to any of the applications(domains) will be redirected to secure port.

Is it possible to configure that with single tomcat instance?

I have two web applications running under tomcat 7.0

  1. https:// secure.example.com:8443
  2. http:// insecure.example.com:8080

They have two separate "host" records in server.xml (different domains, separate locations).

I need first one to be available via HTTPS only. In other words I need insecure requests to secure application to be redirected to secure port. But insecure application still must be available via HTTP.

  • http:// insecure.example.com:8080 - OK
  • https:// secure.example.com:8443 - OK
  • http:// secure.example.com:8080 --> https:// secure.example.com:8443

I know it is possible to specify "redirectPort" in insecure Connector (server.xml) but then HTTP requests to any of the applications(domains) will be redirected to secure port.

Is it possible to configure that with single tomcat instance?

Source Link

Redirect insecure requests of one tomcat application to secure port and don't redirect requests of another application

I have two web applications running under tomcat 7.0

  1. https:// secure.example.com:8443
  2. http:// insecure.example.com:8080

They have two separate "host" records in server.xml (different domains, separate locations).

I need first one to be available via HTTPS only. In other words I need insecure requests to secure application to be redirected to secure port. But insecure application still must be available via HTTP.

  • http:// insecure.example.com:8080 - OK
  • https:// secure.example.com:8443 - OK
  • http:// secure.example.com:8080 --> https:// secure.example.com:8443

I know it is possible to specify "redirectPort" in insecure Connector (server.xml) but then HTTP requests to any of the applications(domains) will be redirected to secure port.

Is it possible to configure that with single tomcat instance?