locked
Hosting an angular application from blob storage container ? RRS feed

  • Question

  • I have successfully hosted angular application using cdn verizon premium using azure storage blob container, I can successfully go to index.html, but I have defined a routing in my angular application If its a web server I would define a rewrite rule in configuration but in cdn I could also define rewrite rule , I have defined the following Rewrite rule For the routing 

    Source Pattern -((?:[^\?]*/)?)($|\?.*)

    destination - $1index.html$2
     

    It didn't worked for my application 

    I would like to achieve  my application should have the URLs below

    hostname/xxxx/?queryParam

    hostname/xxxx/contact?queryParam

    I have followed the following documentation 

    https://docs.microsoft.com/en-us/azure/cdn/cdn-rules-engine-reference-features#url-redirect

    https://stackoverflow.com/questions/49401118/azure-cdn-with-verizon-rewritting-url-to-always-load-index-html

    none could helped me

    Any help That I can get Really apreciated

    Thanks
    Rajitha


     
    • Edited by cssRajitha Monday, April 30, 2018 4:25 PM
    Monday, April 30, 2018 4:23 PM

All replies

  • Your regex looks incorrect. 

    Is the idea to rewrite something like '/contact?query=123' to be '/contact/index.html?query=123'?

    An example would help.

    You can also use tools like https://regex101.com/ to test your regex before using them. 


    Wednesday, May 9, 2018 11:11 PM