PHP+docker-imgproxy 500 Errsors #10
-
Hi, Can provide any files if need if helps, contact via email if want/need. Bob |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
@Skorefin Thank you for sending me the feedback. I'm afraid I don't fully grasp the issue you are facing. If I understand correctly, you added a new service using a separate PHP container in the existing docker-compose.yml for this project, and then tweaked the Nginx configuration to make it work. Is that right? I'm very intrigued by your setup and would love if you could provide the details (feel free to send me an email) so I can better envision where problems could potentially arise. Without specific information on how to reproduce the issue, it will be difficult for me to be of assistance. If possible, please provide me with a minimal setup that allows me to easily see the problem. I appreciate it. Best regards, |
Beta Was this translation helpful? Give feedback.
-
Thanks for your help, now working!
Key info, “it will by default look in the /var/www/html directory of the container,”
All the best,
Bob
From: Shin ***@***.***>
Sent: Wednesday, January 17, 2024 12:50 PM
To: shinsenter/docker-imgproxy ***@***.***>
Cc: skorefin ***@***.***>; Mention ***@***.***>
Subject: Re: [shinsenter/docker-imgproxy] PHP+docker-imgproxy 500 Errsors (Discussion #10)
@Skorefin <https://github.com/Skorefin>
Hi Bob,
After briefly looking through your source code, it seems you have changed the nginx document root from /home to /var/www/html, while your image files are located in /home and mounted to a ./www/ directory on the host machine.
nginx.conf
- set $html_root /home;
+ set $html_root /var/html/www;
docker-compose.yml
imgproxy:
volumes:
- ./www:/home:cached
Therefore, when you access images within your HTML, it will by default look in the /var/www/html directory of the container, and the images were not there.
You can choose to copy all the images in the ./www/ directory over to your ./src/ directory (along with the php files), so imgproxy can find the image files. You should also update the path in the imgproxy env settings:
docker-compose.yml
- IMGPROXY_LOCAL_FILESYSTEM_ROOT: /home
+ IMGPROXY_LOCAL_FILESYSTEM_ROOT: /var/www/html
- IMGPROXY_WATERMARK_PATH: /home/kaws-deckchair_x300.webp
+ IMGPROXY_WATERMARK_PATH: /var/www/html/kaws-deckchair_x300.webp
Here is the result when I did the above fixes:
Screenshot.2024-01-17.at.14.48.35.png (view on web) <https://github.com/shinsenter/docker-imgproxy/assets/2082119/4ad6cfd8-3bb2-47fb-9d52-6c1d1bca1c7d>
Best regards.
TAN
—
Reply to this email directly, view it on GitHub <#10 (reply in thread)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AKZZWKSNEBJG46WZZT2IBJLYO5RBTAVCNFSM6AAAAABB5RWZRSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DCNJSGQZTG> .
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/AKZZWKR4S4V77EOVAXKGF7LYO5RBTA5CNFSM6AAAAABB5RWZRSWGG33NNVSW45C7OR4XAZNRIRUXGY3VONZWS33OINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAPRSXC.gif> Message ID: ***@***.*** ***@***.***> >
|
Beta Was this translation helpful? Give feedback.
@Skorefin
Hi Bob,
After briefly looking through your source code, it seems you have changed the nginx document root from
/home
to/var/www/html
, while your image files are located in/home
and mounted to a./www/
directory on the host machine.nginx.conf
docker-compose.yml
Therefore, when you access images within your HTML, it will by default look in the
/var/www/html
directory of the container, and the images were not there.You can choose to copy all the images in the
./www/
directory over to your./src/
directory (along with the php files), so imgproxy can find the image files. Y…