Turns out to users in the local network must SIMULTANEOUSLY
to a local address and portal.ru
with the external address.
This is simply impossible.
Change local DNS name for example on the portal.loc.
Or use the local IP address instead portal.ru.
Or on the main website store in a cookie, which version of the website now to show, but this is a security hole.