Azure / wordpress-linux-appservice

MIT License
96 stars 65 forks source link

Image uploads returning the wrong URL #127

Closed tannertechnology closed 5 months ago

tannertechnology commented 6 months ago

Hey,

When we attempt to upload images via the media library in wordpress it uploads the image successfully to the blob storage account but the URL it returns isn't correct. We are using Azure Front Door.

It returns: wp-appsvc-afdEndPoint-[redacted].azurefd.net/blobstg[redacted]/wp-content/uploads/2024/01/test.jpg

Which results in error 404. The URL to the image in the blob storage container is more like: https://[redacted].blob.core.windows.net/blobstg[redacted]/wp-content/uploads/2024/01/test.jpg

Which works publicly.

We are using the unmodified wp-config that ships with the image and redeployed this yesterday. This happens with both WP's multi uploader and the browser uploader. Having smush enabled or disabled has no impact.

tannertechnology commented 6 months ago

In wp-config changing

define('WP_CONTENT_URL', '/wp-content');

to

define('WP_CONTENT_URL', 'https://wpstg[redacted].blob.core.windows.net/blobstg[redacted]/wp-content');

Just breaks the site