I found out what is the real method to have a fully working installation of the web adaptor.
Basically, when you install and launch web adaptor, it opens upo in the browser with a URL like "http:\\localhost\arcgis\webadaptor". The protocol (HTTP) and web adaptor name (arcgis) might be different depending on what was specified during installation. If you want to access (e.g.) Portal for ArcGIS from an external machine, YOU HAVE to change the web adaptor URL in the browser to point to a domain which is accessible from outside, and that has a SSL certificate installed.
So, if you already have configured it "the wrong way", you have to first unregister the webadaptor (Unregistering ArcGIS Web Adaptor with Portal for ArcGIS—Installation Guides (10.5) | ArcGIS Enterpri... ).
Then, UNINSTALL it, and reinstall it, changing the URL as I said.
Then, once inside the configuration, just specify the external domain again and you'll see that everything will work just fine.
If you don't change the URL in the browser as I said, it will finish configuring succesfully, you will be able to access the Portal for ArcGIS from outside the server machien wirth the external domain name, BUT as long as you try to log in, you won't be abkle to continue as this procedure will point to the server internal machine name (Fully Qualified Domain Name, or FQDN), which in most of the case is not accessible from a machine which is not the server itself.
NOTE: if you (like me) install ArcGIS Enterprise using ArcGIS Enterprise Builder, it will automatically configure the web adaptors (one for portal, one for sever) with the FQDN. You have to do what I wrote in order to make it work correctly.
Hope this will be of help.
EDIT
Apparently, this will somehow break ArcGIS Server login.
If you press login in the /rest/services, it will stuck to a blank page, the URL being https://<YOUR_EXTERNAL_DOMAIN>/server/login/?returnUrl=https:/<YOUR_EXTERNAL_DOMAIN>/server/rest/services .
Looking at the dev console, it seems to try to get stuck at this request:
https://<FQDN>/portal/sharing/rest/portals/self?f=json&callback=dojo.io.script.jsonp_dojoIoScrip…
So, again, the FQDN is back (don't know why??!!), and it's preventing ArcGIS Server REST (and MANAGER) from logging in from a machine that is not the server itself.
SOLUTION
- go to your ArcGIS Server Administrator directory (https://gisserver.domain.com:6443/arcgis/admin).
- in security -> config and click on "update" (at the bottom of the page).
- change "Authentication tier" from ARCGIS_PORTAL to GIS_SERVER.
- click "Update".
Now, the authentication should work. I don't know if this thing is working wether the server is federated/registered with the portal or not (still struggling to understand this).
EDIT 2
Ok, so... I also had problems with federating/unfederating register/unregister the server with the Portal (which, as far as I know, is key if you want to be able to publish MapServices from ArcGIS Pro to ArcGIS Server passing through Portal).
Maybe the key element is in this requirement, will come back to this if I'll find out.
If you'll be federating your site with Portal for ArcGIS, it's recommended you configure your organization's domain name service (DNS) to include fully qualified domain name (FQDN) entries for each site you intend to federate with the portal. Portal for ArcGIS will request the FQDN of each site when you federate.