You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
URLs generated by GlassFish take into consideration the value of the Server Name configuration value in config -> Network Config -> Protocols -> (listener) -> HTTP. When Server Name is set, its value (including port number if specified) will be used instead of localhost in generated URLs. The generated URLs now always retain the protocol (HTTP or HTTPS) used by the listener.
In case when GlassFish is behind a proxy server, where the proxy server communicates with the outside world via HTTPS, and GlassFish communicates with the proxy via plain HTTP inside an internal network, GlassFish should generate URLs to respect how outside world communicates with the proxy, including using HTTPS in the URL. This doesn't happen now, it's only possible to create URLs with a custom domain and port, but not with a custom protocol. The URLs always start with http:// and there's no way to turn them into https:// in GlassFish.
Add a configuration option for the HTTP protocol, e.g. Server Protocol (to be in line with Server Name), which allows to change the protocol used in the generated URLs. So that if HTTPS is specified, the URL will use the https:// protocol.
Alternatively, allow using the protocol in the Server Name value, so that it could be https://mydomain.com:443". Currently, the protocol is stripped from the value of "Server Name" and the value is changed to just mydomain.com:443`.
Steps to reproduce
Deploy a simple application, e.g. with a html page. Set context root to /myapp.
Configure Server Name for the http-listener-1 to mydomain.com:443
Environment Details
Background (motivation)
URLs generated by GlassFish take into consideration the value of the
Server Name
configuration value inconfig -> Network Config -> Protocols -> (listener) -> HTTP
. WhenServer Name
is set, its value (including port number if specified) will be used instead of localhost in generated URLs. The generated URLs now always retain the protocol (HTTP or HTTPS) used by the listener.In case when GlassFish is behind a proxy server, where the proxy server communicates with the outside world via HTTPS, and GlassFish communicates with the proxy via plain HTTP inside an internal network, GlassFish should generate URLs to respect how outside world communicates with the proxy, including using HTTPS in the URL. This doesn't happen now, it's only possible to create URLs with a custom domain and port, but not with a custom protocol. The URLs always start with
http://
and there's no way to turn them intohttps://
in GlassFish.An example:
Enhancement Description
Add a configuration option for the HTTP protocol, e.g.
Server Protocol
(to be in line withServer Name
), which allows to change the protocol used in the generated URLs. So that if HTTPS is specified, the URL will use the https:// protocol.Alternatively, allow using the protocol in the
Server Name
value, so that it could behttps://mydomain.com:443". Currently, the protocol is stripped from the value of "Server Name" and the value is changed to just
mydomain.com:443`.Steps to reproduce
mydomain.com:443
http://mydomain.com:443/myapp/
(which will end with "The connection was reset" which is expected)With the enhancement and proper configuration, in point 4, the browser would redirect to
https://mydomain.com/myapp/
Impact of Issue
Simpler and safer configuration of a proxy server as a load balancer for a GlassFish cluster.
Type: Enhancement
Component: Network
Priority: Normal
The text was updated successfully, but these errors were encountered: