Browse Source

Fix signalr proxying over nginx

pull/115/head
Gökhan Şengün 4 years ago
parent
commit
0b9237bf20
  1. 5
      etc/docker/docker-compose.yml
  2. 34
      etc/docker/nginx/conf.d/default.conf

5
etc/docker/docker-compose.yml

@ -22,7 +22,8 @@ services:
- eshop-st-web - eshop-st-web
- eshop-st-public-web - eshop-st-public-web
- eshop-st-gateway-web-public - eshop-st-gateway-web-public
- eshop-st-gateway-web - eshop-st-gateway-web
restart: on-failure
networks: networks:
- eshoponabp-network - eshoponabp-network
@ -245,7 +246,7 @@ services:
context: ../../ context: ../../
dockerfile: apps/angular/Dockerfile dockerfile: apps/angular/Dockerfile
volumes: 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: depends_on:
redis: redis:
condition: service_healthy condition: service_healthy

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

@ -3,11 +3,6 @@ server {
server_name eshop-st-administration; server_name eshop-st-administration;
return 301 https://$host$request_uri; return 301 https://$host$request_uri;
location / {
proxy_pass http://eshop-st-administration:80;
proxy_set_header Host $host;
}
} }
server { server {
listen 443 ssl; listen 443 ssl;
@ -124,11 +119,26 @@ server {
location / { location / {
proxy_pass http://eshop-st-public-web:80; proxy_pass http://eshop-st-public-web:80;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_buffer_size 128k; proxy_buffer_size 128k;
proxy_buffers 4 256k; proxy_buffers 4 256k;
proxy_busy_buffers_size 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 { server {
@ -236,16 +246,6 @@ server {
server_name eshop-st-gateway-web-public; server_name eshop-st-gateway-web-public;
return 301 https://$host$request_uri; return 301 https://$host$request_uri;
location / {
proxy_pass http://eshop-st-gateway-web-public:80;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
} }
server { server {
listen 443 ssl; listen 443 ssl;
@ -258,10 +258,8 @@ server {
location / { location / {
proxy_pass http://eshop-st-gateway-web-public:80; proxy_pass http://eshop-st-gateway-web-public:80;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
} }

Loading…
Cancel
Save