Copied to clipboard

Flag this post as spam?

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


  • Marcus 42 posts 183 karma points
    May 14, 2024 @ 09:11
    Marcus
    0

    Umbraco 13.3.0 - URLs generated are non-https

    Hi all,

    I noticed that when running local (development mode). The url of nodes (or media items) generated http or https based on the url. For example:

    enter image description here

    enter image description here

    This is also same when doing content.Url(mode: UrlMode.Absolute) in razor view page

    But when the site hosted. If we access url with https the URLs generated are non-https.

    Is that because my any mistake?

    Thanks for any help!

  • Yakov Lebski 581 posts 2249 karma points
    May 14, 2024 @ 12:42
    Yakov Lebski
    0

    Do you have CDN like Cloudflare or another?

  • Marcus 42 posts 183 karma points
    May 15, 2024 @ 08:06
    Marcus
    0

    Hi Yakov,

    Yes I do. We are using Cloudflare

  • Marcus 42 posts 183 karma points
    May 15, 2024 @ 08:33
    Marcus
    0

    For more about my site, I cannot set UseHttps to true (appsettings.json) because of some conflict in server configuration. If set to true, I will get too many redirects error

    enter image description here

  • Yakov Lebski 581 posts 2249 karma points
    May 15, 2024 @ 13:13
    Yakov Lebski
    0

    it depend on claudflare ssl mode, cloudflare doing ssl teremination. If it flexible website working on 80.

    you can define host header on homepage, techicle it should work with reading header from request

     app.UseForwardedHeaders(new ForwardedHeadersOptions
     {
         ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
     });
    
  • Marcus 42 posts 183 karma points
    May 16, 2024 @ 02:47
    Marcus
    0

    Thank you Yakov,

    Let me try, do I need to push that line before/after any app. ? For example app.UseUmbraco()

  • Marcus 42 posts 183 karma points
    May 17, 2024 @ 16:08
    Marcus
    0

    Hello Yakov,

    I tried but it still does not work. Do you have any other advice?

    Thanks!

    Marcus

  • Yakov Lebski 581 posts 2249 karma points
    May 17, 2024 @ 17:08
    Yakov Lebski
    0

    before UseUmbraco

    Do you know how Cloudflare defined?

    The simple solution is add hostname to you website to be with https

  • Marcus 42 posts 183 karma points
    May 18, 2024 @ 06:40
    Marcus
    0

    Hi Yakov,

    I will ask to try your advice

    Thank you

Please Sign in or register to post replies

Write your reply to:

Draft