The think the url
has to be a fully qualified url including domain name.
I'd recommend setting up the website so a single address is used. You are usually able to access a machine via its external IP address from localhost as well, so a second url wouldn't be needed.
Is this for development purposes, or are you setting up an intranet ? You could have a domain that resolves to a different IP depending on the origin.
If you really need a dynamic website address, you can dynamically set url
based on SERVER variables in config.php
as it's a PHP file. This is not advisable for anything publicly accessible as it leads to duplicate content, negative SEO and possibly cross-origin issues.
PS: /public
should not be in the url. You either need to change your DocumentRoot to be the public folder, or use https://flarum.org/docs/install.html#customizing-paths to remove the public folder. Keeping the storage and vendor folders accessible is a security issue.