artanis
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can Docker/Artanis run on a network server?


From: Mortimer Cladwell
Subject: Re: Can Docker/Artanis run on a network server?
Date: Tue, 30 Mar 2021 17:05:49 -0400

Thanks Nala,

Looking in artanis.conf I see:
## host.name = enable | disable | <boolean>
But you are saying host.name = myhost.com??
 
On AWS I don't have a .com name but I can get an elastic ip, assume 123.45.6.7
 
If I set host.name = 123.45.6.7 I get redirected to 0.0.0.0 - a fail.
 
Assume I want to be redirected to the page /myredirect, if I write a method:
 
(define (get-redirect-uri dest)
   (string->uri (string-append "http://" (get-conf '(host name)) ":3000" dest)))
   
Then (redirect-to rc (get-redirect-uri "/myredirect"))
 
I get redirected to 123.45.6.7:3000/myredirect on AWS with elastic ip, artanis in Docker - success.

What does host.name = enable do? More specifically if I host.name = enable, where do I put the host name?
 
Thanks
Mortimer

 
 

On Tue, Mar 30, 2021 at 3:14 AM Nala Ginrut <mulei@gnu.org> wrote:

Hi Mortimer!

Mortimer Cladwell writes:

> Thanks Nala,
> setting   host.addr = localhost or <myhostname> in artanis.conf doesn't
> work. I am redirected to 0.0.0.0 in both situations using Docker.
> Does this mean Docker is unusable on a LAN?
> And for cloud services like AWS - are there redirection mechanisms that
> work for 0.0.0.0?

[Out of the topic]
I think the host.addr should be the domain name, and it should work if
you deploy it to the cloud. However, this is just one of the ways. My
preferred way is to set host.addr to false, and use Nginx reverse-proxy
on the cloud server.


> In page.scm:
>
> "So let's make it easier, GNU Artanis will always redirect to absolute
> URL for you."
>
> What is the "absolute URL"? The entry in host.addr? That is not
> happening for me with Docker.

Here is the doc:
https://www.gnu.org/software/artanis/manual/manual.html#org164a146

If you use relative path, say "/page1", it'll be
"http://host.addr/page1", this step is handled by Artanis inexplicitly.

So here's the issue, you set host.addr in Docker env with 0.0.0.0, but
the redirect-to will add 0.0.0.0 to the URL automatically. However, the
host address inside Docker is different from the address of host
system. The redirect will fail.

To solve this issue, you may try these steps:
1. host.name = myhost.com (whatever domain name you like)
2. host.addr = 0.0.0.0
3. Set a static DNS for myhost.com, say, /etc/hosts

If you want to host this site/app in a LAN, you may need to set internal
DNS, or if there're not many machines, you may set hosts for each
machine.

Please don't hesitate if there is better advice.

Best regards.

--
GNU Powered it
GPL Protected it
GOD Blessed it
HFG - NalaGinrut
Fingerprint F53B 4C56 95B5 E4D5 6093 4324 8469 6772 846A 0058

reply via email to

[Prev in Thread] Current Thread [Next in Thread]