Skip to content

Commit

Permalink
Put upstream host URLs into env
Browse files Browse the repository at this point in the history
  • Loading branch information
nknguyenhc committed Oct 2, 2024
1 parent cda8522 commit 3acdd85
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ services:

frontend:
build: ./frontend
env_file:
- ./frontend/nginx/.env
ports:
- "80:80"
3 changes: 3 additions & 0 deletions frontend/nginx/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
QUACK=quack
QUESTION_SERVICE_URL=http://question:3002/
USER_SERVICE_URL=http://user:3001/
2 changes: 1 addition & 1 deletion frontend/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ events {

http {
include /etc/nginx/mime.types;
include /etc/nginx/sites-enabled/*;
include /etc/nginx/conf.d/app.conf;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ server {
}

location /api/questions/ {
proxy_pass http://question:3002/;
proxy_pass ${QUESTION_SERVICE_URL};
}

location /api/users/ {
proxy_pass http://user:3001/;
proxy_pass ${USER_SERVICE_URL};
}
}

0 comments on commit 3acdd85

Please sign in to comment.