Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Thomas 319 posts 606 karma points c-trib
    May 18, 2021 @ 12:12
    Thomas
    0

    HTTP site hosted behind HTTPS proxy not using correct protocol when loading avatars and fonts

    Our web site is hosted behind a proxy server which holds the sites SSL certificate.

    So the site sits native in HTTP, but the outside world sees it as HTTPS because of the proxy.

    We have some issue that some stuff from Umbraco are called with http and some with https.

    Ex. The user avatar image And the fonts on the frontend that are loaded with an relative path to the fonts

    Any one knows how to get around that ?? enter image description here enter image description here

    <add key="Umbraco.Core.UseHttps" value="false" /> is added in the webconfig
    
  • Brendan Rice 538 posts 1102 karma points
    May 18, 2021 @ 12:24
    Brendan Rice
    0

    Hi Thomas,

    how is the font being referenced in the template/css?

  • Thomas 319 posts 606 karma points c-trib
    May 18, 2021 @ 12:44
    Thomas
    0

    Hi Brendan,

    They are referenced like this. enter image description here

    It is not possible to add an absolute path because we are using the same css for other projects.

  • Erik Eelman 81 posts 321 karma points
    May 18, 2021 @ 13:57
    Erik Eelman
    0

    Hi Thomas,

    You can try to force umbraco to use https for all backoffice calls with this config setting:

    <add key="Umbraco.Core.UseHttps" value="true" />
    

    More information about this: https://our.umbraco.com/documentation/reference/security/use-https

  • Thomas 319 posts 606 karma points c-trib
    May 18, 2021 @ 14:03
    Thomas
    0

    Hi Erik,

    We all ready has that added.. Still not working..

  • Thomas 319 posts 606 karma points c-trib
    May 18, 2021 @ 14:04
    Thomas
    0

    Sorry that part was not showed in my question..

  • Erik Eelman 81 posts 321 karma points
    May 18, 2021 @ 14:12
    Erik Eelman
    0

    Hi Thomas,

    Did you try to put the complete url including https:// to the website node in the umbraco backend under "Culture and hostnames"?

    If that doesn't work you could also add a rewrite rule to your web.config to force https

    <rule name="Force HTTPS" stopProcessing="true" enabled="true">
          <match url=".*" />
          <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
            <add input="{HTTPS}" pattern="off" ignoreCase="true" />
          </conditions>
          <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
        </rule>
    
  • Søren Gregersen 441 posts 1884 karma points MVP 2x c-trib
    May 18, 2021 @ 14:24
    Søren Gregersen
    0

    this will cause the site to issue a redirect, but since it is behind a proxy, the condition will allways be true, resulting in a redirect loop.

  • Thomas 319 posts 606 karma points c-trib
    May 19, 2021 @ 07:21
    Thomas
    0

    Hi Erik,

    https:// to the website node in the umbraco backend under "Culture and hostnames"?

    This didn't do it..

  • Søren Gregersen 441 posts 1884 karma points MVP 2x c-trib
    May 18, 2021 @ 14:26
    Søren Gregersen
    0

    Hi Thomas,

    Are you able to rewrite the output in the proxy, to override "http:" with "https:"?

    Othervise you would need to make sure that all url's are implemented as https yourself in the html output from your site.

  • Thomas 319 posts 606 karma points c-trib
    May 19, 2021 @ 07:19
    Thomas
    0

    Hi Søren

    Not sure if I can do that, will talk to our server hosting about that.

    It's not possible to make absolute paths that the domain url changes throug projects, but it's the same baseline code they are using.

Please Sign in or register to post replies

Write your reply to:

Draft