The item type will determine where it gets the URL from. If you're creating a web app, the URL is generated from the web context URL or web adaptor URL for Portal. If you're creating a hosted or non-hosted service, the URL is generated from the URL you used for the Services URL during federation. Unfortunately, if you used the wrong URLs, there's no built-in mechanism in the software to correct the URLs within the configuration. You can update the URLs for individual items, but new items will always have the incorrect URL.
I'd first confirm that the URLs above are set incorrectly, then you can update them to point to the correct location. This can be done by editing the existing web adaptor or web context URL that's set, unfederating and re-federating the Server, and cleaning up duplicate items that will show up due to the re-federation.
If this is a sandbox/testing environment and you don't have any content you'd like to preserve, you could just rebuild the site so you don't need to clean anything up.