Hosting on DigitalOcean App Platform - "mixed content"

Has anyone successfully deployed Statamic to DigitalOcean's App Platform?

I've hit multiple issues related to "mixed content" in the control panel. After some digging in this forum and discord, I've made progress, but no complete solution yet.

First, all assets were loading via HTTP, so the browser threw the "mixed content" error. Setting the APP_URL and ASSET_URL to the HTTPS variant and adding laravel-cloudflare (https://github.com/monicahq/laravel-cloudflare) proxies middleware (DO appears to be using Cloudflare) corrected that issue.

Now, AJAX calls with a trailing slash appear to be 301 redirected to an HTTP endpoint, then back to HTTPS with the slash trimmed.

ex:

https://example.com/cp/assets/browse/folders/foobar/?page=1&perPage=30&sort=basename&order=asc&search=

to

http://example.com/cp/assets/browse/folders/foobar/?page=1&perPage=30&sort=basename&order=asc&search=

at which point the "mixed content" error is thrown and we stop. If it wasn't, we'd redirect back to HTTPS:

https://example.com/cp/assets/browse/folders/foobar?page=1&perPage=30&sort=basename&order=asc&search=

Notice the trailing slash is trimmed.

I suspect this is a server configuration "issue" between DO and Cloudflare.

Any suggestions or ideas?

It's worth noting I've added URL::forceScheme('https') to the boot method of AppServiceProvider to no avail.

Would be really nice to get this running on App Platform since it's relatively hands-off.

>>>>>>> Unanswered <<<<<<<
10 Replies
6 Followers