Skip to content

Commit

Permalink
[Fix #50] Add api engine service port into dashboard
Browse files Browse the repository at this point in the history
Add api engine service port info into dashboard,
and replace with varbiale in default.conf.tmpl.

Signed-off-by: Haitao Yue <hightallyht@gmail.com>
  • Loading branch information
hightall committed Oct 24, 2019
1 parent 741c06c commit 9853033
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions bootup/docker-compose-files/docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,6 @@ services:
- api-engine
environment:
- API_PROXY=http://api-engine:8080/engine
- SERVICE_PORT=$API_ENGINE_SERVICE_PORT
ports:
- "${DASHBOARD_SERVICE_PORT}:80"
1 change: 1 addition & 0 deletions bootup/docker-compose-files/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,6 @@ services:
- nginx
environment:
- API_PROXY=http://nginx:80/engine
- SERVICE_PORT=$API_ENGINE_SERVICE_PORT
ports:
- "${DASHBOARD_SERVICE_PORT}:80"
2 changes: 1 addition & 1 deletion build_image/docker/common/dashboard/config-nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

NGINX_RAW_CONFIG=/etc/nginx/conf.d/default.conf.tmpl
NGINX_CONFIG=/etc/nginx/conf.d/default.conf
envsubst '$$API_PROXY' < ${NGINX_RAW_CONFIG} > ${NGINX_CONFIG}
envsubst '$$API_PROXY,$$SERVICE_PORT' < ${NGINX_RAW_CONFIG} > ${NGINX_CONFIG}
2 changes: 1 addition & 1 deletion build_image/docker/common/dashboard/default.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ server {
location /api {
proxy_pass $API_PROXY;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_set_header Host $host:$SERVICE_PORT;
proxy_set_header X-Real-IP $remote_addr;
}
}
Expand Down

0 comments on commit 9853033

Please sign in to comment.