Upload folder alias – Almost working
-
Hi Mateusz,
I might have a bit of a tough one for you.
I use Trellis and Bedrock for all my WP sites: https://roots.io/
It’s an awesome system for versioning and deployment.
It uses NGINX and also creates an alias for the uploads folder.
I got your plugin working but saw it was only working for themes and plugin folders… not uploads.
I looked into it more and saw it was because the uploads folder is an alias to: /srv/www/site.com/shared/uploads
When i look on the server for the path to all the webp images, it is: /srv/www/site.com/current/web/app/uploads-webpc/srv/www/site.com/shared/uploads
So, it looks like the plugin is getting the real path and recreating that in the file system instead of using the alias. It should be: /srv/www/site.com/current/web/app/uploads-webpc/uploads and not have the: /srv/www/site.com/shared
I was then able to make the plugin work for the uploads folder by changing the try line for the nginx settings to: try_files /app/uploads-webpc/srv/www/site.com/shared/$path.$ext.webp $uri =404;
This works fine for uploads folder but of course plugins and themes folders do not work anymore.
Any ideas on what I can do here? I tried a bunch of different paths for add_filter functions but solved all issues. Maybe there is a way to get the plugin to obey the alias? Or some different nginx settings?
Thanks for any help!
Josh
- The topic ‘Upload folder alias – Almost working’ is closed to new replies.