Gaia nginx container not starting

Can you share your hub URL? My hub is working on https://lumstx.tk/hub_info. Did you find any issues in the nginx logs (/var/log/nginx/)?

Hi @mustafaalam958! I haven’t configured the domain name and was not successful with Nginx, I was trying to get Gaia to work on HTTP first. Something like YOUR_IP/hub_info. Were you able to achieve the same? Is SSL or FQDN mandatory for Gaia to work? Please let me know your thoughts. Thank you.

Hello, My guess is that it should work without having to register a domain name, but since I haven’t tried that in practice, so I’m not sure. Can you elaborate on what issues did you get with nginx?

Thank you @mustafaalam958. Regarding Nginx, I guess my config is incorrect. I am seeing the below logs. It will be of great help if you can share your nginx.config and config.json for reference. Thank you.
image

ok. That may be the reason why docker is not able to start. the config.son i use for AWS is below:

ubuntu@lumstx:~/hub$ cat config.json
{
“port”: 3000,
“driver”: “aws”,
“bucket”: “s3-stacks”,
“readURL”: “https://s3-stacks.s3.amazonaws.com/”,
“maxFileUploadSize”: “1000”,
“argsTransport”: {
“level”: “debug”,
“handleExceptions”: true,
“timestamp”: true,
“colorize”: false,
“json”: true
},
“awsCredentials”: {
“accessKeyId”: “XXXXXXXXXXXXXXXXXXXX”,
“secretAccessKey”: “YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY”
}
}

and nginx.conf is:

ubuntu@lumstx:~/hub$ cat nginx.conf
limit_req_zone $binary_remote_addr zone=std_rl:10m rate=10r/s;
limit_req zone=std_rl burst=10 nodelay;

upstream gaia_hub {
server localhost:3000;
}

server {
listen 80;
server_name lumstx.tk;
root /var/www/lumstx.tk/html;
index index.html index.html index.nginx-debian.html;

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://gaia_hub;
break;
}
}

One observation I have, is that the gaia-hub docker is not yet started, the nginx server fails when you restart its service. Once the gaia-hub is started, nginx finds that gaia-hub (upstream) running on localhost:3000, and the service is now in active state, after you give it a restart. I hope this makes sense.

1 Like

Please do note that I used a separate server block (virtual host) for my nginx configuration. If you are working with default, the “server: root” directive will hold a different value.

1 Like

Sure, thank you @mustafaalam958! I will retry the setup referencing your config files. Mine is at root, so Nginx has a different value. I guess, I just have to update the server value. Anyways, I will try once again and will keep you posted on how it went. Thank you so much for your assistance.

Hi, @mustafaalam958 Thank you so much for your assistance! I successfully configured my Gaia hub following the docker setup. I was able to make my Gaia work with HTTP. I really appreciate your support on the same.

1 Like

Hi @mustafaalam958 In continuation to this setup, have you tried pointing your app-level storage to this hub? If so, requesting you to kindly share the steps. Thank you so much.

Hello @HariniRajan. I haven’t looked into the app integration with gaia-hub, but if you look at the sample todos app available you may be able to test the storage through their getfile and putfile functions available in the app by providing your gaia-hub URL in the code.

I ran some tests through stack cli to write (gaia_putfile) and read (gaia_getfile). I was able to place the file on the storage backend but wasn’t successful in reading the file. Some documentation I am currently looking at are:

  1. [Tech Preview] Using your own Gaia hub with the CLI - Apps / Storage (Gaia) - Stacks Forum

  2. [Putting files from backend - Apps / Storage (Gaia)](https://Putting files from backend - Apps / Storage (Gaia) - Stacks Forum)

See if these are helpful in your case.

1 Like

Thank you for the articles, @mustafaalam958. This is very helpful. I will give them a try .Thank you so much.

Hello @HariniRajan … did you have any luck with integrating your gaia-hub with a decentralized app?

Unfortunately, I am not successful yet. I am facing the roadblocks in cli way. Consolidated the issues in this forum post..

Meanwhile, @mustafaalam958 I remember you mentioned put_file worked for you.Have you tried the cli way for the same?

One more thing, I have configured domain name to my gaia hub(gaia.blsy.me). My docker runs on port 3000. So basically, http://gaia.blsy.me:3000/hub_info works whereas http://gaia.blsy.me/hub_info doesn’t work. How to setup proxypass so that I don’t need to access using port 3000. Have you faced this issue? Please help me if you have any leads on the same. My nginx.conf is given below

limit_req_zone $binary_remote_addr zone=std_rl:10m rate=10r/s;
limit_req zone=std_rl burst=10 nodelay;

upstream gaia_hub {
server localhost:3000;
}

server {
listen 80;
server_name gaia.blsy.me;
root /var/www/gaia.blsy.me/html;
index index.html index.html index.nginx-debian.html;

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://gaia_hub;
break;
}
}

Thank you so much!

@mustafaalam958 @HariniRajan

As mentioned, we were able to give this a little attention this week - here is a preview of the docs:
https://blockstack-docs-git-great-gaia-guidance-blockstack.vercel.app/storage-hubs/amazon-ec2-deploy

Give it a shot, and let me know how it works for you - the one caveat or now is we’re limiting the regions to us-east-1 (will adjust in teh future)

1 Like

Sure, @jwiley! I will give it a try and will get back to you if I face any issues. Thank you so much!

Here’s an updated link to the docs page, since the previous link was a demo deployment:
https://docs.stacks.co/storage-hubs/amazon-ec2-deploy

Thank you, @Charlie and @jwiley! I am not able to access the template. Getting the below errorimage . I have cross-checked my account roles and I am able to create new ones using the sample template. Please guide me if I am missing anything. Thank you.

@HariniRajan Whoops, the template wasn’t accessible outside our account. Give it another try now.

1 Like

Yup, it worked now! Thank you @Charlie !

Thank you so much, @jwiley and @Charlie. With the new Stack for AWS, I successfully configured the Gaia Hub following the docs. The directions are very straightforward, and this is extremely beneficial. I greatly appreciate your support!Thank you.

4 Likes