ASPNETCORE_URLS is an environment variable that sets the URL or URLs where an ASP.NET Core application listens. It is especially useful when deploying outside IIS, where the application’s listening address must be configured explicitly. section 27.0 section 27.4
Set a local listening URL
Set ASPNETCORE_URLS to http://localhost:8000, then run the published application in the same command window. ASP.NET Core uses that value and listens on port 8000 locally. section 27.4
Use the value carefully because the address determines which requests the application accepts:
- Separate multiple URLs with semicolons, such as http://localhost:5001;http://*:5002. section 27.4
- Use localhost to accept requests only from the local computer; use * to accept requests on that port through any URL mapped to the computer. section 27.4
- Do not use this setting to bind to one named domain; ASP.NET Core listens to requests on the port rather than filtering domain names. section 27.4
- For an API that must reject HTTP entirely, configure only an HTTPS URL, such as https://*:5001. section 28.4.3
http://localhost:5001;http://*:5002
Compare a local-only endpoint with a wildcard endpoint in one configuration value. section 27.4
