Browse Source

Merge pull request #113 from abpframework/docker-config-fix

eShopOnAbp: SignalR error on k8s & docker-compose. Url re-write to https
pull/117/head
Galip Tolga Erdem 4 years ago
committed by GitHub
parent
commit
d261dd9c4f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs
  2. 21
      etc/docker/docker-compose.yml
  3. 121
      etc/docker/nginx/conf.d/default.conf

6
apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs

@ -19,6 +19,7 @@ using Microsoft.IdentityModel.Protocols.OpenIdConnect;
using StackExchange.Redis;
using System;
using System.Net.Http.Headers;
using Microsoft.AspNetCore.HttpOverrides;
using Volo.Abp;
using Volo.Abp.Account;
using Volo.Abp.AspNetCore.Authentication.OpenIdConnect;
@ -216,6 +217,11 @@ public class EShopOnAbpPublicWebModule : AbpModule
{
app.UseErrorPage();
}
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});
app.UseCorrelationId();
app.UseStaticFiles();

21
etc/docker/docker-compose.yml

@ -22,7 +22,8 @@ services:
- eshop-st-web
- eshop-st-public-web
- eshop-st-gateway-web-public
- eshop-st-gateway-web
- eshop-st-gateway-web
restart: on-failure
networks:
- eshoponabp-network
@ -52,7 +53,7 @@ services:
condition: service_healthy
rabbitmq:
condition: service_healthy
restart: on-failure
restart: on-failure
networks:
- eshoponabp-network
eshop-st-identity:
@ -74,15 +75,15 @@ services:
- RabbitMQ__Connections__Default__HostName=rabbitmq
- IdentityServerClients__Web__RootUrl=https://eshop-st-web
- IdentityServerClients__PublicWeb__RootUrl=https://eshop-st-public-web
- IdentityServerClients__WebGateway__RootUrl=https://localhost:44372
- IdentityServerClients__WebGateway__RootUrl=https://eshop-st-gateway-web
- IdentityServerClients__PublicWebGateway__RootUrl=https://eshop-st-gateway-web-public
- IdentityServerClients__IdentityService__RootUrl=https://eshop-st-identity
- IdentityServerClients__AdministrationService__RootUrl=https://eshop-st-administration
- IdentityServerClients__AccountService__RootUrl=https://eshop-st-authserver
- IdentityServerClients__CatalogService__RootUrl=https://localhost:44354
- IdentityServerClients__BasketService__RootUrl=https://localhost:44355
- IdentityServerClients__OrderingService__RootUrl=https://localhost:44356
- IdentityServerClients__PaymentService__RootUrl=https://localhost:44357
- IdentityServerClients__CatalogService__RootUrl=https://eshop-st-catalog
- IdentityServerClients__BasketService__RootUrl=https://eshop-st-basket
- IdentityServerClients__OrderingService__RootUrl=https://eshop-st-ordering
- IdentityServerClients__PaymentService__RootUrl=https://eshop-st-payment
depends_on:
redis:
condition: service_healthy
@ -245,7 +246,7 @@ services:
context: ../../
dockerfile: apps/angular/Dockerfile
volumes:
- ./nginx/dynamic-env.json://usr/share/nginx/html/dynamic-env.json
- ./nginx/dynamic-env.json:/usr/share/nginx/html/dynamic-env.json
depends_on:
redis:
condition: service_healthy
@ -285,7 +286,7 @@ services:
context: ../../
dockerfile: gateways/web/src/EShopOnAbp.WebGateway/Dockerfile
environment:
- ASPNETCORE_ENVIRONMENT=Docker # Yarp can't resolve dns, needs to be overridden
#- ASPNETCORE_ENVIRONMENT=Docker # Yarp can't resolve dns, needs to be overridden
- ASPNETCORE_URLS=http://+:80;
- App__SelfUrl=https://eshop-st-gateway-web
- App__CorsOrigins=https://eshop-st-web
@ -300,8 +301,6 @@ services:
- ReverseProxy__Clusters__feature-management-cluster__Destinations__destination1__Address=http://eshop-st-administration
- ReverseProxy__Clusters__permission-management-cluster__Destinations__destination1__Address=http://eshop-st-administration
- ReverseProxy__Clusters__setting-management-cluster__Destinations__destination1__Address=http://eshop-st-administration
# ports:
# - "44372:443"
depends_on:
redis:
condition: service_healthy

121
etc/docker/nginx/conf.d/default.conf

@ -1,5 +1,10 @@
server {
listen 80;
server_name eshop-st-administration;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name eshop-st-administration;
@ -15,6 +20,16 @@ server {
}
server {
listen 80;
server_name eshop-st-identity;
return 301 https://$host$request_uri;
location / {
proxy_pass http://eshop-st-identity:80;
proxy_set_header Host $host;
}
}
server {
listen 443 ssl;
server_name eshop-st-identity;
@ -30,6 +45,16 @@ server {
}
server {
listen 80;
server_name eshop-st-authserver;
return 301 https://$host$request_uri;
location / {
proxy_pass http://eshop-st-authserver:80;
proxy_set_header Host $host;
}
}
server {
listen 443 ssl;
server_name eshop-st-authserver;
@ -41,11 +66,20 @@ server {
location / {
proxy_pass http://eshop-st-authserver:80;
proxy_set_header Host $host;
add_header from-ingress true;
}
}
server {
listen 80;
server_name eshop-st-web;
return 301 https://$host$request_uri;
location / {
proxy_pass http://eshop-st-web:80;
proxy_set_header Host $host;
}
}
server {
listen 443 ssl;
server_name eshop-st-web;
@ -65,6 +99,16 @@ server {
}
server {
listen 80;
server_name eshop-st-public-web;
return 301 https://$host$request_uri;
location / {
proxy_pass http://eshop-st-web:80;
proxy_set_header Host $host;
}
}
server {
listen 443 ssl;
server_name eshop-st-public-web;
@ -75,15 +119,40 @@ server {
location / {
proxy_pass http://eshop-st-public-web:80;
proxy_set_header Host $host;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
}
location /signalr-hubs {
proxy_pass http://eshop-st-public-web:80;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
server {
listen 80;
server_name eshop-st-basket;
return 301 https://$host$request_uri;
location / {
proxy_pass http://eshop-st-basket:80;
proxy_set_header Host $host;
}
}
server {
listen 443 ssl;
server_name eshop-st-basket;
@ -99,6 +168,16 @@ server {
}
server {
listen 80;
server_name eshop-st-catalog;
return 301 https://$host$request_uri;
location / {
proxy_pass http://eshop-st-catalog:80;
proxy_set_header Host $host;
}
}
server {
listen 443 ssl;
server_name eshop-st-catalog;
@ -114,6 +193,16 @@ server {
}
server {
listen 80;
server_name eshop-st-ordering;
return 301 https://$host$request_uri;
location / {
proxy_pass http://eshop-st-ordering:80;
proxy_set_header Host $host;
}
}
server {
listen 443 ssl;
server_name eshop-st-ordering;
@ -129,6 +218,16 @@ server {
}
server {
listen 80;
server_name eshop-st-payment;
return 301 https://$host$request_uri;
location / {
proxy_pass http://eshop-st-payment:80;
proxy_set_header Host $host;
}
}
server {
listen 443 ssl;
server_name eshop-st-payment;
@ -144,6 +243,11 @@ server {
}
server {
listen 80;
server_name eshop-st-gateway-web-public;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name eshop-st-gateway-web-public;
@ -154,11 +258,24 @@ server {
location / {
proxy_pass http://eshop-st-gateway-web-public:80;
proxy_set_header Host $host;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
server {
listen 80;
server_name eshop-st-gateway-web;
return 301 https://$host$request_uri;
location / {
proxy_pass http://eshop-st-gateway-web:80;
proxy_set_header Host $host;
}
}
server {
listen 443 ssl;
server_name eshop-st-gateway-web;

Loading…
Cancel
Save