sixeyed / diamol

Code samples for the book "Learn Docker in a Month of Lunches"
https://www.manning.com/books/learn-docker-in-a-month-of-lunches
Creative Commons Attribution Share Alike 4.0 International
496 stars 261 forks source link

Ch20 - HTTP 403 Access to image-gallery.local was denied #63

Open brian4ko opened 1 year ago

brian4ko commented 1 year ago

Exercise Section 20.2 / page 390

Problem Receive HTTP 403 Access to image-gallery.local was denied. TTY-ed into Nginx, and the cert files are present under /etc/nginx/certs.

Docker version Client: Cloud integration: v1.0.29 Version: 20.10.17 API version: 1.41 Go version: go1.17.11 Git commit: 100c701 Built: Mon Jun 6 23:09:02 2022 OS/Arch: windows/amd64 Context: default Experimental: true

Server: Docker Desktop 4.12.0 (85629) Engine: Version: 20.10.17 API version: 1.41 (minimum version 1.12) Go version: go1.17.11 Git commit: a89b842 Built: Mon Jun 6 23:01:23 2022 OS/Arch: linux/amd64 Experimental: true containerd: Version: 1.6.8 GitCommit: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6 runc: Version: 1.1.4 GitCommit: v1.1.4-0-g5fd4c4d docker-init: Version: 0.19.0 GitCommit: de40ad0

Code version Please run git log -n 1 and paste the output.

Additional context Certs seem to be getting created successfully and copied to my host ./cert and then being binded into nginx at /etc/nginx/certs

Browsing to the website and examining the cert indicates it is invalid. The details of the cert are:

Issued To: Common Name (CN) VMware Organization (O) Organizational Unit (OU) VMware

Issued By: Common Name (CN) VMware Organization (O) Organizational Unit (OU) VMware

Validity Period: Issued On Saturday, April 25, 2020 at 3:23:10 PM Expires On Sunday, April 25, 2021 at 3:23:10 PM

Does the validity of the cert matter here and its expiration dates? (is it being generated properly here? Surprised it says VMware). Is the diamol/cert-generator container flawed now?

I'm no expert in certs, but normally if you click the warning and go proceed/advance, you can still get to the site even if it's expired. Instead i get rejected.

General research says 403 errors pertain to: Cause 1: Incorrect Index File (index file is there; website works fine on http) Cause 2: Incorrectly set permissions (i went to all the image gallery containers and changed all files/directories in /web to rwx using chmod 777)

So these causes don't seem likely. Anyone out there can help point me the right direction and troubleshoot?

Googling creating nginx certs seems quite lengthy and complicated process. Is there an recommended easy guides to follow?

Many thanks to anyone who can help out!