A different approach but with almost the same effect is to use Apache with different virtual hosts and html redirect (optional with htaccess for extra security).
The difference in end result will be that you can not deep-link a http request to https, so people accessing http://www.example.org will be redirected to https://www.example.org, but people who try to access http://www.example.org/existing/link.html will get a 404 page not found error. Once entered through http they will just continue server via https, so this is only an issue for existing links or people typing their own links (and forget https).
Maybe this could be achieved with the mod rewrite but I have not tested this so I am not sure if it is possible to do the redirect to a different port.
The setup would look like this:
Virtual host 1: is default server and listens to port 443
This host will consist of the main external webpages.
To setup virtual hosts, see
Virtual host 2: listens to port 80 to the name http://externaldomainname.org
with an optional alias http://www.externaldomainname.org
In the root of this virtual host only one file exist, a html redirect.
To do html redirecting, see
Virtual host 3: listens to port 80 to a local name (localhost or hostname)
will only be accessible from localhost for local applications.
if real security is required, access should be limited by use of htaccess.
To limit access through htaccess, see