wodby/docker4wordpress

Permission issues with /var/www/html

Tuuuukka opened this issue · 1 comments

Codebase

Mounted codebase

Host OS

Manjaro Linux (Arch)

I get this error on nginx logs if I use mounted codebase and try to access the site after containers are up and running:
[error] 44#44: *1 directory index of "/var/www/html/" is forbidden, client: 172.19.0.5, server: default, request: "GET / HTTP/1.1", host: "PROJECT.docker.localhost:8000"

Unsurprisingly the browser says 403 forbidden too.

I have no idea why this happens, as it all works perfectly if I use vanilla WP (Drupal sites all work ok too) with default settings; the /var/www/html is suddenly not forbidden.

On my mounted codebase project I have only changed the necessary stuff, like DB settings and project name etc. No change to ports, paths or anything like that. Portainer and PMA both work fine, so the problem must be with WP and its settings, no?

Ok, I got this covered. It was an issue with the folder structure, as I was using web/ folder in my project root to hold the mounted codebase. So if anyone else has a problem with this, don't use a separate folder for the codebase, just put it all in the project root with all the composer and docker related files where you run make up.