Skip to content

Commit 5901810

Browse files
Add: nginx into the docker folder
1 parent c3b9db8 commit 5901810

File tree

3 files changed

+37
-3
lines changed

3 files changed

+37
-3
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,5 @@ node_modules
8989
ui/static/ui/js/*
9090
*.js.map
9191
secrets
92-
nginx.conf
93-
Dockerfile
92+
/nginx.conf
93+
/Dockerfile

compose.login-hanko.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ services:
6262
depends_on:
6363
- app
6464
volumes:
65-
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
65+
- ./docker/nginx.conf:/etc/nginx/conf.d/default.conf:ro
6666
- static-files:/static:ro
6767
- export-downloads:/export_downloads:ro
6868
networks:

docker/nginx.conf

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
upstream django {
2+
server app:8000;
3+
}
4+
5+
server {
6+
listen 80;
7+
server_name https://export.testlogin.hotosm.org/ localhost;
8+
9+
client_max_body_size 100M;
10+
11+
# Static files
12+
location /static/ {
13+
alias /static/;
14+
expires 30d;
15+
add_header Cache-Control "public, immutable";
16+
}
17+
18+
# Export downloads
19+
location /downloads/ {
20+
alias /export_downloads/;
21+
expires 1d;
22+
}
23+
24+
# Proxy to Django
25+
location / {
26+
proxy_pass http://django;
27+
proxy_set_header Host $host;
28+
proxy_set_header X-Real-IP $remote_addr;
29+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
30+
proxy_set_header X-Forwarded-Proto https;
31+
proxy_set_header X-Forwarded-Host $host;
32+
proxy_redirect off;
33+
}
34+
}

0 commit comments

Comments
 (0)