-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d571f7
commit 8b17d15
Showing
6 changed files
with
76 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
# Placeholder for max file transfer size | ||
client_max_body_size ${CLIENT_MAX_BODY_SIZE}; | ||
|
||
server { | ||
listen 80; | ||
server_name localhost ${SERVER_IP}; # Handles both localhost and server IP | ||
|
||
location / { | ||
proxy_pass http://jwt-frontend:3000/; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
|
||
location /api/ { | ||
proxy_pass http://fastapi-app:8149/; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_read_timeout 300s; | ||
proxy_connect_timeout 75s; | ||
} | ||
|
||
location /mongo/ { | ||
proxy_pass http://mongodb:27017/; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
#!/bin/bash | ||
|
||
# Determine which config to use based on DEBUG value | ||
if [ "$DEBUG" = "True" ]; then | ||
CONFIG_PATH="/etc/nginx/dev/nginx.conf.template" | ||
else | ||
CONFIG_PATH="/etc/nginx/prod/nginx.conf.template" | ||
fi | ||
|
||
# Substitute environment variables in the nginx template | ||
envsubst '${CLIENT_MAX_BODY_SIZE} ${DOMAIN_NAME}' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf | ||
envsubst '${CLIENT_MAX_BODY_SIZE} ${SERVER_IP}' < $CONFIG_PATH > /etc/nginx/nginx.conf | ||
|
||
# Start NGINX | ||
exec nginx -g 'daemon off;' |