XHR requests related to graphql being blocked (request URL http instead of https)

Hi there,

I’m having a issue on my staging instance (SS_ENVIRONMENT_TYPE=“test”) that is hosted on AWS. In the CMS, I’m unable to access the /admin/assets/ area and I see three ‘Mixed block’ console errors as follows:

GET http://[my staging url]/admin/graphql/types
GET http://[my staging url]/admin/assets/admin.types.graphql
POST http://[my staging url]/admin/graphql

My staging website is being served over https (and https is forced by CloudFlare). Obviously these requests are being blocked due to the origin being http but I’m unsure how to update them to https. I’m unable to replicate the issue on my local instance which works fine.

A work around I have found is to disable forcing https which does work (i.e. I’m able to access /admin/assets/) but isn’t a good solution as I need to test over https and I can’t understand why the issue is isolated to these few graphql related XHR requests.

Any help would be much appreciated,

Many thanks,
Todd

Have you tried setting the alternate_base_url config? In a config/app.yml file:

SilverStripe\Control\Director:
  alternate_base_url: '`SS_BASE_URL`'

My setups run in Docker containers with Traefik in front of them and SS thinks it’s not https. The SS_BASE_URL in the example is an environment variable. Substitute for an actual url if not using those variables.

1 Like