I have configured a Docker container to run Nginx and setup the /etc/nginx/sites-available/default file as shown below
server { listen 80 default_server; list
You have interchanged the ports. According to this command line -p 8080:443 -p 8081:80, you should do:
-p 8080:443 -p 8081:80
https://example.com:8080 note this is https
https://example.com:8080
and
http://example.com:8081
This should work