Connecting to host name instead of IP address

This is the place to discuss DynFi Manager installation and deployment.
Not to be confused with DynFi Firewall installation.

Moderator: gregober

Post Reply
thowe
Posts: 4
Joined: 21 Aug 2022, 19:28

Connecting to host name instead of IP address

Post by thowe » 21 Aug 2022, 19:42

When using the system host name, the login page is displayed,
but there is an error shown that says:
"Error fetching access token!
NetworkError when attempting to fetch resource."
Nothing is displayed in the log.

I have seen a topic in this forum on this issue, and it says that if I have "corsAllowOrigin=*"
set that this issue should be fixed. However, I have set corsAllowOrigin=* , and verified that it is set
by using "--print-config". However, this issue persists.

What must be done to fix this in the short term?
In future I plan to use Apache or Nginx in front of the server, but while testing I would like
to use host name.

Also, are there instructions on using nginx or Apache as a proxy? I did not see this in the docs.
User avatar
gregober
Posts: 236
Joined: 26 Mar 2019, 15:06

Re: Connecting to host name instead of IP address

Post by gregober » 23 Aug 2022, 01:51

thowe wrote: 21 Aug 2022, 19:42 When using the system host name, the login page is displayed,
but there is an error shown that says:
"Error fetching access token!
NetworkError when attempting to fetch resource."
Nothing is displayed in the log.
This is probably related to DNS settings in the hosting server.
Can you confirm that you can resolve the FQDN you are accessing the DynFi Manager service with ?
thowe wrote: 21 Aug 2022, 19:42 I have seen a topic in this forum on this issue, and it says that if I have "corsAllowOrigin=*"
set that this issue should be fixed. However, I have set corsAllowOrigin=* , and verified that it is set
by using "--print-config". However, this issue persists.

What must be done to fix this in the short term?
In future I plan to use Apache or Nginx in front of the server, but while testing I would like
to use host name.

Also, are there instructions on using nginx or Apache as a proxy? I did not see this in the docs.
The setting with

Code: Select all

corsAllowOrigin=*
should be ok.
More info can be found here : https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

Regarding config for reverse proxy, you can check this topic:
viewtopic.php?t=205

Or you can "get inspired" by this Nginx DynFi Manager config ;-)

Code: Select all

server {
   listen 80 default_server;
   listen [::]:80 default_server;
   server_name your.name.com;
   return 301 https://$server_name$request_uri;
}

server {
   listen 443 ssl http2 default_server;
   listen [::]:443 ss1 http2 default_server;
   server_name your.name.com;
   location /config.js {
      proxy_pass http://192.168.xxx.yyy:9090;
      sub_filter http://192.168.xxx.yyy:9090'  'https://$shost';
      sub_filter_types"*";
   }
   location / {
      proxy_passhttp://192.168.xxx.yyy:9090;
   }

   ssl_dhparam/etc/ssl/certs/dhparam.pem;

   ssl_certificate/etc/ssl/dynfi/bundle.crt;
   ssl_certificate_key/etc/ssl/dynfi/client.dynfi.com.key;
}
Of course, you'll need to generate your cert and all things tied to this.
thowe
Posts: 4
Joined: 21 Aug 2022, 19:28

Re: Connecting to host name instead of IP address

Post by thowe » 23 Aug 2022, 03:20

This is probably related to DNS settings in the hosting server.
Can you confirm that you can resolve the FQDN you are accessing the DynFi Manager service with ?
Yes the host name I am using is the public name of the machine itself.
It has both A and AAAA records...
Is it possible it is confused by the presence of the v6 record?
Could it be trying to use that to access something else like the mongodb database?
I am only running Dynfi at the public v4 address, so if it is trying to do something with the AAAA record it maybe shouldn't(?)
User avatar
gregober
Posts: 236
Joined: 26 Mar 2019, 15:06

Re: Connecting to host name instead of IP address

Post by gregober » 23 Aug 2022, 06:37

Normally the default way to access the DynFi Manager is either :

Code: Select all

http://your.domain.xxx:9000

or

Code: Select all

http://your.ip.address:9000
It should work with either IPv4 or IPv6.
Can you access your service with any of these methods?
thowe
Posts: 4
Joined: 21 Aug 2022, 19:28

Re: Connecting to host name instead of IP address

Post by thowe » 24 Aug 2022, 04:24

Yes, IP address works fine.

Host name also connects, and the login screen is displayed.
But it also displays the error, and login fails. See my original post.
User avatar
gregober
Posts: 236
Joined: 26 Mar 2019, 15:06

Re: Connecting to host name instead of IP address

Post by gregober » 26 Aug 2022, 11:09

Which system are you running dynfi manager on ?
thowe
Posts: 4
Joined: 21 Aug 2022, 19:28

Re: Connecting to host name instead of IP address

Post by thowe » 27 Aug 2022, 06:58

gregober wrote: 26 Aug 2022, 11:09 Which system are you running dynfi manager on ?
OpenBSD 7.1
OpenJDK 11
User avatar
gregober
Posts: 236
Joined: 26 Mar 2019, 15:06

Re: Connecting to host name instead of IP address

Post by gregober » 29 Aug 2022, 08:45

thowe wrote: 27 Aug 2022, 06:58
gregober wrote: 26 Aug 2022, 11:09 Which system are you running dynfi manager on ?
OpenBSD 7.1
OpenJDK 11
While our app should work on OpenBSD or FreeBSD, this is not part of the supported system that we are advertising.
I would strongly suggest that you try installing DynFi Manager on Ubuntu / Debian / RedHat / Suze types of Linux systems.

Some users have managed to make the app work on Windows (though this system is not supported), so I have no doubt that you can manage to make this work, but It would be more difficult for us to help you debug your installation.
Post Reply