diff --git a/Dockerfile b/Dockerfile index dbd9936..04f59ea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,4 +18,4 @@ ENV SSL_ENABLED="true" COPY entrypoint.sh /entrypoint.sh ENTRYPOINT [ "/entrypoint.sh" ] -CMD ["nginx", "-g", "daemon off;"] +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 8140b2f..ff40804 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -22,7 +22,6 @@ else fi replaceVariables body-main.conf >> "$NGINX_OUTPUT_CONFIG_FILE" for SERVICE in ${SERVICES}; do - echo $SERVICE replaceVariables "body-${SERVICE}.conf" >> "$NGINX_OUTPUT_CONFIG_FILE" done replaceVariables footer.conf >> "$NGINX_OUTPUT_CONFIG_FILE" diff --git a/nginx-templates/body-default.conf b/nginx-templates/body-default.conf index 56c1e99..3ff21c7 100644 --- a/nginx-templates/body-default.conf +++ b/nginx-templates/body-default.conf @@ -26,3 +26,21 @@ rewrite ^/third-party-license-notice/(.*)$ /$1 break; proxy_pass http://$third_party_license_notice; } + + location /multiplayer-server/api/ { + rewrite ^/multiplayer-server/(.*)$ /$1 break; + proxy_pass http://$multiplayer_server; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + } + + location /multiplayer-server/ws { + proxy_pass http://$multiplayer_server; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_read_timeout 60s; + } \ No newline at end of file diff --git a/nginx-templates/body-main.conf b/nginx-templates/body-main.conf index 7754982..e239864 100644 --- a/nginx-templates/body-main.conf +++ b/nginx-templates/body-main.conf @@ -24,6 +24,7 @@ set $towercrush_backend ###DEPLOYMENT_NAME###-towercrush-backend###LOCAL_DOMAIN###; set $towerdefense ###DEPLOYMENT_NAME###-towerdefense###LOCAL_DOMAIN###; set $towerdefense_backend ###DEPLOYMENT_NAME###-towerdefense-backend###LOCAL_DOMAIN###; + set $multiplayer_server ###DEPLOYMENT_NAME###-multiplayer-server###LOCAL_DOMAIN###; proxy_buffer_size 128k; proxy_buffers 4 256k;