Skip to content

Commit 99b4845

Browse files
Merge pull request #1415 from IFRCGo/fix/prod-nginx-setup
Fix prod nginx setup
2 parents b7543c4 + 9a01bbd commit 99b4845

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

main/nginx.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,5 @@ server {
4343
proxy_pass http://unix:/home/ifrc/django_app.sock;
4444
}
4545
}
46+
47+
# This environment is CHANGE_ME_BEFORE_START.

main/runserver.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,17 @@ python manage.py collectstatic --noinput -l
99
python manage.py make_permissions
1010

1111
# Add server name(s) to django settings and nginx - later maybe only nginx would be enough, and ALLOWED_HOSTS could be "*"
12-
if [ "$API_FQDN"x = prddsgocdnapi.azureedge.netx ]; then
13-
sed -i 's/\$NGINX_SERVER_NAME/'$API_FQDN' api.go.ifrc.org goadmin.ifrc.org/g' /etc/nginx/sites-available/nginx.conf
12+
if [ "$API_FQDN"x = goadmin.ifrc.orgx ]; then
13+
sed -i 's/\$NGINX_SERVER_NAME/'$API_FQDN' api.go.ifrc.org/g' /etc/nginx/sites-available/nginx.conf
1414
else
1515
sed -i 's/\$NGINX_SERVER_NAME/'$API_FQDN'/g' /etc/nginx/sites-available/nginx.conf
1616
fi
17+
# Just a temporary test:
18+
if [ "$GO_ENVIRONMENT"x = productionx ]; then
19+
sed -i 's/CHANGE_ME_BEFORE_START/prod/' /etc/nginx/sites-available/nginx.conf
20+
else
21+
sed -i 's/CHANGE_ME_BEFORE_START/'$GO_ENVIRONMENT'/' /etc/nginx/sites-available/nginx.conf
22+
fi
1723

1824
# Prepare log files and start outputting logs to stdout
1925
touch $HOME/logs/gunicorn.log

0 commit comments

Comments
 (0)