-
Notifications
You must be signed in to change notification settings - Fork 31
How to make it work in production on your own VPS #936
Description
Hi, I'm stuck on something for a few days now, I've already tried nhost locally and it's amazing, now I've rented a vps so I can now upload it to "production" in short it works worldwide and not on my local machine anymore.
But I can't find any tutorial on how to configure this correctly, maybe I'm missing something.
I'm using Ubuntu 18.04, I installed nhost and docker on my server, then I typed nhost init and nhost up, and my server ran, but it still had the "local.nhost.run" urls, the problem is that this only works locally.
I tried using custom domains first, and this is what was added to my tml (For now I'm just trying to test with hasura):
[hasura.resources]
[hasura.resources.networking]
[[hasura.resources.networking.ingresses]]
fqdn = ['hasura.nhost.codeasi.info']
but when I logged in it didn't load anything, I got the following error:
root@vmi2129016:/opt/nhostchat# curl https://hasura.nhost.codeasi.info/
curl: (60) SSL certificate problem: self-signed certificate
More details here: https://curl.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
So now I had to put a certificate, but as I have always used hestia cp, I relied on es, now my server has hestiacp, port 433 is occupied, now I run my service like this:
nhost up --http-port 7000
And it works, that is, now I get this:
URLs:
Postgres: postgres://postgres:postgres@localhost:5432/local
Hasura: https://local.hasura.local.nhost.run:7000/
GraphQL: https://local.graphql.local.nhost.run:7000/
Auth: https://local.auth.local.nhost.run:7000/
Storage: https://local.storage.local.nhost.run:7000/
Functions: https://local.functions.local.nhost.run:7000/
Dashboard: https://local.dashboard.local.nhost.run:7000/
Mailhog: https://local.mailhog.local.nhost.run:7000/
Then I configured the SSL in nginx with hestiacp and my domain already had SSL, now I just did a proxy pass with nginx:
location / {
proxy_pass https://local.hasura.local.nhost.run:7000/;
}
But now when I enter https://hasura.nhost.codeasi.info/ I get 404 page not found
So my question is, how do I get this working in production, what should I do?
I would like to stop using local.hasura.local.nhost.run and have all services now with IP for example:
31.220.100.214:7001
31.220.100.214:7002
31.220.100.214:7003
To simply redirect them with nginx and make everything easier, I saw that 4 years ago nhost was like this, it didn't give you a local domain name, it gave you your server IP with ports, I would like to do this when doing nhost up, or what do you recommend, any help would be welcome.