55: " ${WORKER_CONNECTIONS:= 2048} "
66: " ${APP_PORT:= 80} "
77: " ${API_PORT:= 80} "
8+ : " ${NGINX_RESOLVER:= 127.0.0.11} "
9+ : " ${BACKEND_SERVICE:= tactical-backend} "
10+ : " ${FRONTEND_SERVICE:= tactical-frontend} "
11+ : " ${MESH_SERVICE:= tactical-meshcentral} "
12+ : " ${WEBSOCKETS_SERVICE:= tactical-websockets} "
813: " ${DEV:= 0} "
914
1015CERT_PRIV_PATH=${TACTICAL_DIR} /certs/privkey.pem
3439if [[ $DEV -eq 1 ]]; then
3540 API_NGINX="
3641 #Using variable to disable start checks
37- set \$ api http://tactical-backend :${API_PORT} ;
42+ set \$ api http://${BACKEND_SERVICE} :${API_PORT} ;
3843 proxy_pass \$ api;
3944 proxy_http_version 1.1;
4045 proxy_cache_bypass \$ http_upgrade;
@@ -51,7 +56,7 @@ if [[ $DEV -eq 1 ]]; then
5156else
5257 API_NGINX="
5358 #Using variable to disable start checks
54- set \$ api tactical-backend :${API_PORT} ;
59+ set \$ api ${BACKEND_SERVICE} :${API_PORT} ;
5560
5661 include uwsgi_params;
5762 uwsgi_pass \$ api;
6166nginx_config=" $( cat << EOF
6267# backend config
6368server {
64- resolver 127.0.0.11 valid=30s;
69+ resolver ${NGINX_RESOLVER} valid=30s;
6570
6671 server_name ${API_HOST} ;
6772
@@ -80,7 +85,7 @@ server {
8085 }
8186
8287 location ~ ^/ws/ {
83- set \$ api http://tactical-websockets :8383;
88+ set \$ api http://${WEBSOCKETS_SERVICE} :8383;
8489 proxy_pass \$ api;
8590
8691 proxy_http_version 1.1;
@@ -111,13 +116,13 @@ server {
111116
112117# frontend config
113118server {
114- resolver 127.0.0.11 valid=30s;
119+ resolver ${NGINX_RESOLVER} valid=30s;
115120
116121 server_name ${APP_HOST} ;
117122
118123 location / {
119124 #Using variable to disable start checks
120- set \$ app http://tactical-frontend :${APP_PORT} ;
125+ set \$ app http://${FRONTEND_SERVICE} :${APP_PORT} ;
121126
122127 proxy_pass \$ app;
123128 proxy_http_version 1.1;
@@ -149,7 +154,7 @@ server {
149154
150155# meshcentral config
151156server {
152- resolver 127.0.0.11 valid=30s;
157+ resolver ${NGINX_RESOLVER} valid=30s;
153158
154159 listen 443 ssl;
155160 proxy_send_timeout 330s;
@@ -163,7 +168,7 @@ server {
163168
164169 location / {
165170 #Using variable to disable start checks
166- set \$ meshcentral http://tactical-meshcentral :443;
171+ set \$ meshcentral http://{ $MESH_SERVICE } :443;
167172
168173 proxy_pass \$ meshcentral;
169174 proxy_http_version 1.1;
@@ -180,7 +185,7 @@ server {
180185}
181186
182187server {
183- resolver 127.0.0.11 valid=30s;
188+ resolver ${NGINX_RESOLVER} valid=30s;
184189
185190 listen 80;
186191 server_name ${MESH_HOST} ;
0 commit comments