Asset link not working when deployed

Hii there,

I made a little script that watermarks images I use on my blog.
This works perfectly fine when I use it on my local dev machine but once I deploy it to the server (it uses Docker so it pretty much can’t be due to the nginx configs) and try to load up an image using it, it tells me “Missing Controller”.

The link on my local machine is:

http://localhost:8080/assets/img/cache/5afdd99612c1af45072215f52ed080ebf382616e.png

Whilist the link on my deployment server (staging) is:

https://testing.finlaydag33k.nl/assets/img/cache/5afdd99612c1af45072215f52ed080ebf382616e.png

The code is exactly the same, the nginx config is exactly the same, the app.php is nearly exactly the same (only changes in the password and username of the DB n stuff) which makes this error really weird.
I have checked the logs but no clue here (only what we’ve already know).
The file I’m trying to access exists and is owned by the same user that runs PHP (as well as chmodded to 0777 for testing purposes).

I tink you have different APP_DIR and CAKE_CORE_INCLUDE_PATH.
Re read installation maual .

I have taken a look at it and there doesn’t seem to be anything different at all outside of the username and password used for the database (which is set using an environment variable).
The code on the development machine is identical to the code that gets deployed.

if you can edit nginx conf file try adding

  access_log /var/www/html/public/logs/server_access.log;
  error_log /var/www/html/public/logs/server_error.log;

to your server block, just note your path can be different ie in my dev env i put them into cake logs path

then you should get something like

172.19.0.1 - - [24/Jan/2019:04:04:48 +0000] "GET /images/thumbnails/2f602030-63cd-419f-a913-7340f48a2e03_280x140.webp HTTP/1.1" 200 1015 "http://localhost:8080/en-US/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"

or reason why its not served

I found the issue (major facepalm here)…
I work using Docker and the nginx and php container are two different containers…
I only checked whether the files existed on the php container and completely forgot to check whether the images existed on the nginx container… which they didn’t (hence nginx just passes it all to CakePHP, which tries to look for a controller).

I apparently forgot to add the volume containing the images to the nginx container…