1

I'm trying to deploy a basic ionic 4 application to spaces CDN provided by digitalocean.

I uploaded the static website on gitlabpages and the website is working. I've tried to replicate the results on spaces CDN but the file instead of being opened by the browser get downloaded once opened.

I figured out it could be the --base-href, and I tried to modify it, but without success, the index file provided by the build still get downloaded

At first I build the ionic app

ionic build --prod --base-href="xxx.gitlab.io/xxx" //code used to deploy for gitlab pages

Then for gitlab pages I deployed it using gitlab-ci.yml file, as explained here, while for deploying on spaces I used a python script

I would expect to be able to upload an ionic build into spaces CDN and being able using the link provided to see the website.

I'm not sure if I'm doing something wrong at conceptual level using a CDN, it is actually my first time trying to serve a website using this tech.

UPDATE I've uploaded to the CDN again, and I realized that if I use the origin link, it actually load the html (even tho it gives me a lot of errors). While is I use the CDN link, it try to download the file.

I have purged the cache of the CDN so in my opinion the CDN and the origin should behave exactly the same, Am I wrong?

Zeno Trevisan
  • 517
  • 1
  • 8
  • 23

0 Answers0