Unable to serve frontity page thru https although http works

Hello Everyone, I have been playing around with frontity for a couple of weeks now and I have decided to make my blog using frontity. I have run across several issues trying to serve a frontity project form a vps.

After days of trying to deploy my frontity website on my vps with no success and right before I was ready to ditch frontity for good I noticed that the frontity website is successfully being serve thru http but not https. Any guess as to why that happens and how I can fix it? I have google and google for a solution and I have found nothing on the subject. I ran another nodejs app and it successfully runs on my domain on https. I’m sure there is a file on frontity I must configure but I have found nothing on the subject in the frontity docs. I’m running ubuntu 16.04 and apache2 on my vps and the certificate is from let’s encrypt. I also have a second vps running nginx and having the same issue. Although the nginx server I cannot see the frontity project working thru the domain since it redirects to https but it displays when I input the server ip into the address bar.

Also is it possible to run frontity with pm2 ??? or how can i serve frontity as a background service?? Frontity claims that it is like any other node.js app but I don’t think that is true. Please help me with my problem. Let me know what information I am missing to help fix this problem. And I promise to make a Guide for anyone running into the same issue because so far I haven’t find anything useful and I have been googling for days.

Hi @f4b13l90

Welcome to the community. I’m glad you decided to hang in there with Frontity! :grinning:

Do you have a repo so that we can take a look at your code?

Meanwhile check that the WP api that you’re connecting to and configuring in frontity.settings.js is also using HTTPS.

{
    "name": "@frontity/wp-source",
    "state": {
        "source": {
            "api": "https://my-site.com/wp-json"
        }
    }
}

Thank you so much for replying. Still haven’t gotten it to work. I have checked and indeed my wp test blog and it is being served thru https and the settings file is also as yo have it.

I pushed my code to this repo .
https://github.com/fabielone/frontityblog

and wp blog is hosted at https://fabielramirez.com/wpinstallxyz/

and I’m trying to deploy the blog at fabiel.mx (sorry can only post 2 links because I am a new user ).

I been doing some more reading on frontity and it seems like it is still in its early stages. So the only straightforward way to deploy is thru vercel ??

Hey @f4b13l90 thanks for sharing your issues here.

It’s true that right now our deploy section in the docs only recommends Vercel, but we are working on adding more deployment guides. In any case, Frontity Sites can be deployed anywhere you can deploy a React App.

Here you have some threads where other community members explain how they have deployed frontity:

Please let us know if they help you with your issue

Thanks for the reply. I read those posts but I am unable to find the command.js file. Was it removed or rename in the distro?? Trying to run with pm2 with no luck so far.

@f4b13l90 Frontity should work just fine with pm2. What problems are you having?

Hi @f4b13l90

Frontity is not yet as established as, say, Gatsby or Next - but then we don’t have the resources that those two frameworks have. However, Frontity has been around for a while and has been fully battle-tested and battle-hardened in commercial deployments prior to being open-sourced a little over a year ago.

Deployment to Vercel is indeed very straightforward, but it’s not the only straightforward way to deploy a Frontity-based site. The reason we recommend Vercel, apart from it’s ease of use, is because you get the stale-while-revalidate cache-control directive baked in without any additional configuration on your part (Vercel’s own term for it is Serverless Pre-Rendering).

This technique provides performance benefits out of the box that would require configuration on other hosts. So we recommend Vercel because it is, as you say, ‘straightforward’ - but if you’re prepared to configure cache control directives on other hosting services such as Netlify or Heroku, or if you’re willing to sacrifice the performance benefits (e.g. because you’re just testing out Frontity) then deploying there shouldn’t be particularly complicated.