locked
Unable to force www and https RRS feed

  • Question

  • Hi.

    I am hosting Hugo website on Azure Blob delivered via Verizon premium cdn.

    I added my website using www with CDN SSL certificate and non-www.

    • http://marusiak.pl - not working
    • http://www.marusiak.pl - works
    • https://marusiak.pl  - not working
    • https://www.marusiak.pl - works

    This are my rules:

    <rules schema-version="2" rulesetversion="5" rulesetid="1068357" xmlns="http://www.whitecdn.com/schemas/rules/2.0/rulesSchema.xsd">
      <rule id="2248341" platform="http-large" status="active" version="2" custid="BD5CD">
        <!--Changed by userId: 1112 on 08/19/2019 07:57:57 AM GMT-->
        <!--Changed by 94d54bd8-62b1-439b-973e-943a2c0f1df4@cdn.windowsazure.com on 08/19/2019 07:54:13 AM GMT from IP: 62.143.110.190-->
        <!--Changed by 94d54bd8-62b1-439b-973e-943a2c0f1df4@cdn.windowsazure.com on 08/19/2019 07:46:43 AM GMT from IP: 62.143.110.190-->
        <description>Force https</description>
        <!--If-->
        <match.always>
          <feature.url-redirect code="301" pattern="/00BD5CD/(.*)" value="https://{host}/$1" />
        </match.always>
      </rule>
    </rules>

    c

    <rules schema-version="2" rulesetversion="5" rulesetid="1068357" xmlns="http://www.whitecdn.com/schemas/rules/2.0/rulesSchema.xsd">
      <rule id="2248456" platform="http-large" status="active" version="1" custid="BD5CD">
        <!--Changed by userId: 1112 on 08/19/2019 07:57:58 AM GMT-->
        <!--Changed by 94d54bd8-62b1-439b-973e-943a2c0f1df4@cdn.windowsazure.com on 08/19/2019 07:55:28 AM GMT from IP: 62.143.110.190-->
        <!--Changed by 94d54bd8-62b1-439b-973e-943a2c0f1df4@cdn.windowsazure.com on 08/19/2019 07:55:13 AM GMT from IP: 62.143.110.190-->
        <description>force www</description>
        <!--If-->
        <match.host value="marusiak.pl">
          <feature.url-redirect code="301" pattern="/00BD5CD/(.*)" value="https://www.marusiak.pl/$1" />
        </match.host>
      </rule>
    </rules>

    Monday, August 19, 2019 8:27 AM

All replies

  • Hi, 

    The reason why it is failing is because "marusiak.pl" domain is not resolvable from Internet. When I tried to resolve www.marusiak.pl, it does resolve to an IP. All you need to do is to create a CNAME record in your registrar which points to the CDN FQDN. 

    Regards, 

    Msrini

    Monday, August 19, 2019 10:42 AM
  • The problem is that I can't. I host my domain at OVH and they don't allow this to do when there is already CNAME to www.marusiak.pl.

    How can I fix this?

    Monday, August 19, 2019 11:47 AM
  • Do you mean that they won't allow to create CNAME for apex domains?

    Please follow the steps to point apex domain to Azure CDN : https://docs.microsoft.com/en-us/azure/dns/dns-alias#point-zone-apex-to-azure-cdn-endpoints

    Let me know if you have any further questions. 

    Regards, 

    Msrini

    Monday, August 19, 2019 12:06 PM
  • Hi, 

    Do you have any update on this issue?

    Regards, 

    Msrini

    Friday, August 23, 2019 6:41 AM
  • Still doesn't work. 

    I configured the following.

    CNAME to www.marusiak.pl pointing to marusiakplcdn.azureedge.net and marusiak.pl to marusiakplcdn.azureedge.net.

    dig www.marusiak.pl
    
    ; <<>> DiG 9.10.6 <<>> www.marusiak.pl
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8370
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 1232
    ;; QUESTION SECTION:
    ;www.marusiak.pl.		IN	A
    
    ;; ANSWER SECTION:
    www.marusiak.pl.	300	IN	CNAME	marusiakplcdn.azureedge.net.
    marusiakplcdn.azureedge.net. 1800 IN	CNAME	marusiakplcdn.ec.azureedge.net.
    marusiakplcdn.ec.azureedge.net.	3600 IN	CNAME	scdn138cd.wpc.bd5cd.phicdn.net.
    scdn138cd.wpc.bd5cd.phicdn.net.	3600 IN	CNAME	sni1gl.wpc.phicdn.net.
    sni1gl.wpc.phicdn.net.	993	IN	A	152.199.20.88
    
    ;; Query time: 65 msec
    ;; SERVER: 192.168.255.254#53(192.168.255.254)
    ;; WHEN: Fri Aug 23 11:25:19 CEST 2019
    ;; MSG SIZE  rcvd: 198

    dig marusiak.pl
    
    ; <<>> DiG 9.10.6 <<>> marusiak.pl
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64772
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 1232
    ;; QUESTION SECTION:
    ;marusiak.pl.			IN	A
    
    ;; ANSWER SECTION:
    marusiak.pl.		300	IN	A	152.199.20.88
    
    ;; Query time: 312 msec
    ;; SERVER: 192.168.255.254#53(192.168.255.254)
    ;; WHEN: Fri Aug 23 11:26:14 CEST 2019
    ;; MSG SIZE  rcvd: 56

    curl http://marusiak.pl
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    	<head>
    		<title>404 - Not Found</title>
    	</head>
    	<body>
    		<h1>404 - Not Found</h1>
    	</body>
    </html>
    
    
    curl http://www.marusiak.pl
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    	<head>
    		<title>404 - Not Found</title>
    	</head>
    	<body>
    		<h1>404 - Not Found</h1>
    	</body>
    </html>
    
    
    curl https://marusiak.pl
    curl: (51) SSL: no alternative certificate subject name matches target host name 'marusiak.pl'
    
    
    curl https://www.marusiak.pl
    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
      <title>Wojciech Marusiak CV</title>

    http://marusiak.pl - doesn't work

    http://www.marusiak.pl - doesn't work

    https://marusiak.pl - doesn't work, wrong SSL certificate. No the one I have in portal.

    https://www.marusiak.pl - works


    Friday, August 23, 2019 9:26 AM
  • Hi, 

    When I tried accessing http://marusiak.pl it throws 404. 

    At least the DNS resolution is working now. Now you need to set the http to https re-direction to get the site up and running. 

    I do not see any re-direction happening now. 

    Regards, 

    Msrini

    Friday, August 23, 2019 10:00 AM
  • No changes on my side.

    Here are my rules:

    <rules schema-version="2" rulesetversion="8" rulesetid="1068357" xmlns="http://www.whitecdn.com/schemas/rules/2.0/rulesSchema.xsd">
      <rule id="2248341" platform="http-large" status="active" version="3" custid="BD5CD">
        <!--Changed by userId: 1112 on 08/23/2019 12:12:56 PM GMT-->
        <!--Changed by 94d54bd8-62b1-439b-973e-943a2c0f1df4@cdn.windowsazure.com on 08/23/2019 10:03:24 AM GMT from IP: 178.202.6.189-->
        <description>Force https</description>
        <!--If-->
        <match.always>
          <feature.url-redirect code="301" pattern="/00BD5CD/(.*)" value="https://www.marusiak.pl/$1" />
        </match.always>
      </rule>
    </rules>

    <rules schema-version="2" rulesetversion="8" rulesetid="1068357" xmlns="http://www.whitecdn.com/schemas/rules/2.0/rulesSchema.xsd">
      <rule id="2262720" platform="http-large" status="active" version="0" custid="BD5CD">
        <!--Changed by userId: 1112 on 08/23/2019 12:12:57 PM GMT-->
        <!--Changed by 94d54bd8-62b1-439b-973e-943a2c0f1df4@cdn.windowsazure.com on 08/23/2019 10:46:51 AM GMT from IP: 178.202.6.189-->
        <description>Force www</description>
        <!--If-->
        <match.host value="marusiak.pl">
          <feature.url-redirect code="301" pattern="/00BD5CD/(.*)" value="https://www.marusiak.pl/$1" />
        </match.host>
      </rule>
    </rules>

    Friday, August 23, 2019 12:35 PM
  • Hi, 

    Can you drop an email to azcommunity@microsoft.com with your subscription ID? I will enable one time free support to get this issue resolved. 

    Regards, 

    Msrini

    Thursday, August 29, 2019 12:03 PM
  • Hi guys,

    So at the end, how should be configured the OVH settings. I'm lost between the CDN and OVH...

    I have the same problem, only https://www.  works thanks to the CNAME.

    Wednesday, September 11, 2019 12:17 PM
  • OVH doesn't support root domain pointing to other domain. You can do it in CloudFlare, AWS Route53 or dnssimple. I was able to do it in CloudFlare.
    Wednesday, September 11, 2019 1:06 PM
  • Thanks for your quick answer,

    But, Cloudflare isn't just like the Verizon CDN ? how come you don't have the same problem?
    or should i transfert my domain to another provider ?

    I just wanted to have https on my storage blob. isn't any other easier and cheaper solutions ? :/

    Wednesday, September 11, 2019 1:33 PM
  • It is like any other CDN but you can use it just for the DNS in that case. 

    Make sure to have the grey icon in your dns entry. If it is orange it means whole traffic will be cached by CL.

    Wednesday, September 11, 2019 1:45 PM
  • Hi guys,

    Since last time i switch from ovh to namecheap, same problem, so as you suggested i used cloudflare, it works great, i can add both CNAMEs on root and www. But Azure cant "find my dns record" for the root. (for days)

    (now i'm also using the verizonCDN)

    Any clue on what should  i do?

    Saturday, September 21, 2019 2:06 PM
  • Hi. It is actually very easy.

    https://docs.microsoft.com/en-us/azure/cdn/cdn-map-content-to-custom-domain

    Simply create a cdnverify.snapaca.com pointing to your destination. This works very fast.

    Monday, September 23, 2019 8:06 AM