Angular on AWS (Cloudfront/S3) for Safari

前端 未结 2 827
难免孤独
难免孤独 2021-01-13 22:11

I have issues viewing my site on Safari. I know there is lots of information to find but I can\'t figure out what would actually work.

I have an Angular app with an

相关标签:
2条回答
  • 2021-01-13 22:55

    I found another solution which also allows to have multiple angular apps in subfolders of one bucket and use subdomains at will

    S3 Static Website Hosting Route All Paths to Index.html

    0 讨论(0)
  • 2021-01-13 23:11

    I found the solution. Apparently the hash in Safari and ios is not dropped if you are using https protocol. You have to add the protocol to S3 redirect options like this:

    <Redirect>
        <Protocol>https</Protocol>
        <HostName>test.example.com</HostName>
        <ReplaceKeyPrefixWith>#!/</ReplaceKeyPrefixWith>
    </Redirect>
    

    In this example I point to Cloudfront distribution which supports https. With the new Certificate manager it is very easy to install a free SSL certificate.

    0 讨论(0)
提交回复
热议问题