How do I set up a static site + backend?

First time Linode user. I'm trying to set up a simple website, with pocketbase running as the backend on a linode and the static files being hosted on an object storage bucket. I also purchased a domain from google domains, let's say mydomain.dev
I would like to serve the website at myproject.mydomain.dev, while the backend should be reachable at backend.myproject.mydomain.dev

For the backend, I created an A record inside the mydomain.dev domain that points from the hostname "backend.myproject" to the IP of my linode. However, when launching pocketbase I get the following error: listen tcp: lookup backend.myproject.mydomain.dev on 139.162.133.5:53: no such host which looks to me like an error in identifying the address on the linode DNS.

For the website, I created a CNAME record with Hostname = "myproject" and "Aliases To" = "${storage_bucket_name}.eu-central-1.linodeobjects.com". Is this correct? Could I create a record with Hostname = '@' and just have a static site at the domain's URL?

Sorry for the stream of questions, but the setup of what I thought was a simple process hasn't been simple at all, and the guides didn't really help me out.

1 Reply

Pocketbase
Looking over the issues on the GitHub repo for PocketBase, this issue has been reported before. According to the answer there,

You could try starting the application with 127.0.0.1 instead of the default localhost, eg.:

pocketbase.exe serve --http="127.0.0.1:8090

Once you've started PocketBase with this option, you should be up and running.

CNAME Record
Based on the static website configuration documentation, and the documentation regarding custom domain names and Object Storage, you will need to have a subdomain (in this case, myproject) configured to correctly redirect traffic to your bucket.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct