Plus - how looks the configuration - like this - assuming ServerRootAddress runs under port 8080 ? "ServerRootAddress": "http://localhost:8080/", "ClientRootAddress": "https://client.mycompany.com/", "CorsOrigins": "http://*.mycompany.com,http://localhost:4200,http://localhost:8100,http://localhost:44342,http://localhost:8101,http://localhost:50538,http://localhost:61782",
?
Ok- there are no Code changes needed?
could it be like this?
To use HTTP within the cluster while keeping external access over HTTPS, you can make the following changes without applying extensive code modifications (as suggested in the ASPZERO blog post):
Changes in appsettings.json:
ServerRootAddress: Change the backend URL for internal communication to http://localhost:8080 (instead of https://myExternalDomain-api.com ClientRootAddress: Keep this URL as https://myExternalDomain.com to ensure external access over HTTPS. CorsOrigins: Update CORS to allow the Angular app to access the backend over http://localhost:8080 for internal communication.
Example for appsettings.json:
{ "ServerRootAddress": "http://localhost:8080", // Internal HTTP communication "ClientRootAddress": "https://myExternalDomain.com", // External HTTPS communication "CorsOrigins": "http://localhost:8080", // CORS for internal communication "SwaggerEndPoint": "/swagger/v1/swagger.json" }
Ensure that the ASPNETCORE_URLS=http://+:8080 environment variable is set in the Docker container (either in the Dockerfile or docker-compose.yml) so the backend listens on HTTP inside the container. 3. CORS Configuration:
Configure CORS in the backend to allow requests from the Angular app, even though it communicates over HTTP.
In Summary:
Internally within the cluster: HTTP (e.g., http://localhost:8080)
Externally: HTTPS (e.g., https://myExternalDomain.com)
thanks - locks quite a big change is coding... Could it be a solution to deploy Angular App and aspnet code in one image container? or some other hints?
... would do something like this: // Check the Redis connection string var redisConnectionString = _appConfiguration["Abp:RedisCache:ConnectionString"]; if (!string.Equals(redisConnectionString, "localhost", StringComparison.OrdinalIgnoreCase)) { // Uncomment this line to use Redis cache instead of in-memory cache. // See app.config for Redis configuration and connection string Configuration.Caching.UseRedis(options => { options.ConnectionString = redisConnectionString; options.DatabaseId = _appConfiguration.GetValue<int>("Abp:RedisCache:DatabaseId"); }); }
Hi,
thanks - when I include this - we have also installations where UseRedis is not needed - then if no redis is configured - how is the behaviour then?
Configuration.Caching.UseRedis(options => { options.ConnectionString = _appConfiguration["Abp:RedisCache:ConnectionString"]; options.DatabaseId = _appConfiguration.GetValue<int>("Abp:RedisCache:DatabaseId"); });
this is Edge Browser Hardcopy