Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different directory names between site and S3 bucket #417

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

erasmusa
Copy link

My use case

I already have an S3 bucket containing all the Wordpress Multisite's media files but the uploads directory is not called "uploads". The website is also behind an existing CDN so the URL path needs to remain the same which includes that "/uploads/" section of the path but the S3 bucket should not have that. I'm also not using the URL rewrites and configured nginx to reverse proxy to the S3 private bucket by signing the headers in the request.. The only missing bit was that the plugin needed to make this distinction in folder/directory names between the URL and the S3 bucket.

This is my attempt at achieving this goal.

To make this work add the following line to wp-config.php

define('S3_UPLOADS_DROP_UPLOADS_DIR', true);

Feel free to improve on this - I had to get something up and running quickly.

Copy link

@hm-linter hm-linter bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting failed (1023 errors).

(1014 notices occurred in your codebase, but were on files/lines not included in this PR.)

@noplanman
Copy link

@erasmusa Do you mind sharing the header signing part of the reverse proxy? I've been trying to achieve this too but am running into this issue: anomalizer/ngx_aws_auth#17

Do you have a different method or is there an existing config or how-to/tutorial you can point me to?
Thanks!

@erasmusa
Copy link
Author

@noplanman Sorry for this late reply. Things have been a bit hectic on my end of the woods. I'll write up some instructions for you on how to achieve the header signing in nginx - I just need to retrace my steps first ;-)

@noplanman
Copy link

@erasmusa Just a gentle ping, as I still haven't managed to get it to work without issues 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants