Running strapi on a production server - what exactly is the url in server.js

Hi,

locally strapi runs under localhost:1337 but on my server (running with apache) i want to run strapi under a domain. I thought the url config option in server.js is the right option (https://mydomain/admin) but nothing happens. The browser shows a network timeout but after npm run develop it shows me exactly this url. After that i changed the url back to localhost and added a proxy to the vhost config:

ProxyRequests off
ProxyPass / http://127.0.0.1:1337/
ProxyPassReverse / http:/127.0.0.1:1337/

and then it is working. Is this the only solution? What is the url configuration for? Does it work without a proxy configuration? I want to understand how it works.

Did you figure out your answer?
I am also looking into this via DigitalOcean.

Thanks!