Skip to content

Commit ba6d1af

Browse files
Merge pull request #1419 from IFRCGo/fix/nginx-config-header-not-provided
When HEADER is not provided, mute requests
2 parents 8c325b1 + 0e98e3d commit ba6d1af

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

deployments/snapshots/snap_tests.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
'programme_type_display': 'Bilateral'
3030
},
3131
{
32-
'count': 4,
32+
'count': 5,
3333
'programme_type': 1,
3434
'programme_type_display': 'Multilateral'
3535
},
3636
{
37-
'count': 3,
37+
'count': 2,
3838
'programme_type': 2,
3939
'programme_type_display': 'Domestic'
4040
}
@@ -82,6 +82,11 @@
8282
'primary_sector': 1,
8383
'primary_sector_display': 'PGI'
8484
},
85+
{
86+
'count': 1,
87+
'primary_sector': 2,
88+
'primary_sector_display': 'CEA'
89+
},
8590
{
8691
'count': 3,
8792
'primary_sector': 3,
@@ -103,7 +108,7 @@
103108
'primary_sector_display': 'NS Strengthening'
104109
},
105110
{
106-
'count': 3,
111+
'count': 2,
107112
'primary_sector': 8,
108113
'primary_sector_display': 'Education'
109114
},
@@ -310,8 +315,8 @@
310315
'projects_per_sector': [
311316
{
312317
'count': 1,
313-
'primary_sector': 8,
314-
'primary_sector_display': 'Education'
318+
'primary_sector': 2,
319+
'primary_sector_display': 'CEA'
315320
}
316321
],
317322
'society_name': 'society-name-qJTgrVtaadVUrcYCxAcjpXhdUBtXcCXMFkLAHVklUJGQvVYtjD',

main/nginx.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,10 @@ server {
4444
}
4545
}
4646

47+
server {
48+
listen 80 443;
49+
server_name "";
50+
return 444;
51+
}
52+
4753
# This environment is CHANGE_ME_BEFORE_START.

main/runserver.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,11 @@ 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 = goadmin.ifrc.orgx ]; then
13-
sed -i 's/\$NGINX_SERVER_NAME/'$API_FQDN' api.go.ifrc.org/g' /etc/nginx/sites-available/nginx.conf
14-
else
15-
sed -i 's/\$NGINX_SERVER_NAME/'$API_FQDN'/g' /etc/nginx/sites-available/nginx.conf
16-
fi
17-
# Just a temporary test:
1812
if [ "$GO_ENVIRONMENT"x = productionx ]; then
13+
sed -i 's/\$NGINX_SERVER_NAME/'$API_FQDN' api.go.ifrc.org/g' /etc/nginx/sites-available/nginx.conf
1914
sed -i 's/CHANGE_ME_BEFORE_START/prod/' /etc/nginx/sites-available/nginx.conf
2015
else
16+
sed -i 's/\$NGINX_SERVER_NAME/'$API_FQDN'/g' /etc/nginx/sites-available/nginx.conf
2117
sed -i 's/CHANGE_ME_BEFORE_START/'$GO_ENVIRONMENT'/' /etc/nginx/sites-available/nginx.conf
2218
fi
2319

0 commit comments

Comments
 (0)