Hi there,
Please excuse me, I’m probably going to ask some very dumb questions, I don’t know too much about infrastructure and domains/routing.
I am building a sass and the custom hostnames features sound like something I want to implement.
I think it makes it easier to describe my actual app before the problem:
I’m building a simple photography website builder, you create an account, uploads pic, modify some theme settings and a I generate a static site and host it on a sub domain.
Main site: www.impressionportfolios.com
(it’s on Cloudflare)
Custom genrated site: space-rat.impressionportfolios.com
I want to allow customers to use there own domains. I set up a test domain also on Cloudflare, pointing aydinhassan.uk
to space-rat.impressionportfolios.com
via a cname record.
The custom hostname (aydinhassan.uk
) is registered and verified.
However, aydinhassan.uk
is 404ing, space-rat.impressionportfolios.com
works fine.
Currently the static sites are served via a wildcard server block in nginx like:
server {
server_name ~^(?<domain>.+)\.impressionportfolios\.com$;
listen 443 ssl;
...ssl certs
index index.html;
location / {
root /some/path/builds/$domain;
try_files $uri $uri/ =404;
}
}
Is it still my job to make sure (in the nginx config) that the customers domain (aydinhassan.uk
) is routed to the correct folder?
Finally, I really don’t understand what the fallback origin is? Currently I set it to *.impressionportfolios.com
. Could anyone maybe explain or give an example when and what it is used for?
Again, sorry for the probably dumb questions, and many thanks for taking the time to read.
Best,
Aydin