Currently I have setup
docker
with linux ubuntu 18.04
In my container reverent_ptolemy
contains the project of my api.
On my container
HTTP vhosts configuration is listening to 3021
HTTPS vhosts configuration is listening to 1250
and on my Host
port 3021
is mapped to port 80
port 1250
is mapped to port 443
In my host
docker
I can access my api through HTTPS Curl
like this
curl https://<sub-domain>/api/login
But when I tried to access this from the browser
this gives me an error like this
PS:
Only http://<subdomain>/api/login
is accessible from the outside world not the https
What could be the reason why HTTPS is only accessible on the host and container but not accessible from the outside world?
First of all check iptables (if you allow https traffic) or directly add a rule on the fly (will not be available after reboot or iptables restart - this is just for test sake):
iptables -I INPUT -p TCP --dport 443 -j ACCEPT
Secondly, you were trying to use GET method for your API when most likely it only allows POST method.
I solved my problem.
First if you're trying to do SSL on your docker. Make sure your
443
port is forwarded. You may check your 443 port if it is open or closedhere : https://www.yougetsignal.com/tools/open-ports/