• Resolved DarcPress

    (@darcpress)


    Basically the <script> tag outputted by webpack uses HTTP while my site is on HTTPS

    This can be reproduced if your domain is in Cloudflare and set SSL Setting to “Flexible” instead of “Full”.

    If set to “Full” then it’s fixed, but DigitalOcean doesn’t allow Full SSL, so I must use Flexible SSL if in DigitalOcean.

    Any fix for this?

    Edit: After reading what Flexible SSL means, this bug is unavoidable. Luckily this plugin can fix it https://wordpress.org/plugins/cloudflare-flexible-ssl/

    Thanks

    • This topic was modified 5 years, 10 months ago by DarcPress.
Viewing 1 replies (of 1 total)
  • Theme Author Creative Themes

    (@creativethemeshq)

    Hi @darcpress,

    Thanks a lot for reaching out.

    First of all, we have to clear out that Webpack has nothing to do with this. Webpack receives a flag “public_url” from the WP backend which is used as it is as a prefix for all the <script> URLs. Here’s how this flag is generated:

    'public_url' => get_template_directory_uri() . '/static/bundle/'

    So, if get_template_directory_uri() gives back a non-ssl URL — webpack will use just that. I’m suspecting that the plugin you’ve mentioned makes get_template_directory_uri() (and this family of functions) to return HTTPS links, in hopes that DigitalOcean will properly translate them to plain http, to be consumed by DigitalOcean.

    Hope this clears out the Webpack situation.

    Also, it’s really a strange thing that DigitalOcean doesn’t accept full SSL. Why’s that an issue for you? If you’re using a DO droplet that is configured by yourself, you should be able to easily allow HTTPS traffic on the 443 port without any problem. I think this is the best solution to this problem, frankly.

    Anyway, hope this helps and make sure to let us know if there’s any other we can we can assist you, cheers!

Viewing 1 replies (of 1 total)

The topic ‘Mixed Content Error from the Bundle JS (Webpack)’ is closed to new replies.