File tree Expand file tree Collapse file tree 2 files changed +79
-0
lines changed Expand file tree Collapse file tree 2 files changed +79
-0
lines changed Original file line number Diff line number Diff line change
1
+ version : " 3.9"
2
+
3
+ services :
4
+ nginx :
5
+ container_name : nginx
6
+ image : nginx:latest
7
+ restart : unless-stopped
8
+ ports :
9
+ - 80:80
10
+ - 443:443
11
+ volumes :
12
+ - ./nginx/templates:/etc/nginx/templates:ro
13
+ - ./nginx/ssl:/etc/ssl:ro
14
+ env_file :
15
+ - ./.env.nginx
16
+ depends_on :
17
+ - app
18
+
19
+ app :
20
+ build :
21
+ context : .
22
+ target : production
23
+ dockerfile : Dockerfile
24
+ env_file :
25
+ - .env
Original file line number Diff line number Diff line change
1
+ ssl_certificate /etc/ssl/${DOMAIN}.pem;
2
+ ssl_certificate_key /etc/ssl/${DOMAIN}.key;
3
+
4
+ ssl_session_cache shared:le_nginx_SSL:10m;
5
+ ssl_session_timeout 1440m;
6
+ ssl_session_tickets off;
7
+
8
+ ssl_protocols TLSv1.2 TLSv1.3;
9
+ ssl_prefer_server_ciphers off;
10
+
11
+ ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
12
+
13
+ # Specify a DNS resolver
14
+ resolver 127.0.0.11 valid=30s;
15
+ resolver_timeout 5s;
16
+
17
+ map $host $backend {
18
+ onchain.${DOMAIN} http://app:3000;
19
+ }
20
+
21
+ # websockets
22
+ map $http_upgrade $connection_upgrade {
23
+ default upgrade;
24
+ '' close;
25
+ }
26
+
27
+ server {
28
+
29
+ server_name *.${DOMAIN};
30
+ listen [::]:443 ssl ipv6only=on;
31
+ listen 443 ssl;
32
+
33
+ location / {
34
+ proxy_pass $backend;
35
+ proxy_set_header Host $host;
36
+ proxy_set_header X-Real-IP $remote_addr;
37
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
38
+ proxy_set_header X-Forwarded-Proto $scheme;
39
+ proxy_http_version 1.1;
40
+ proxy_set_header Upgrade $http_upgrade;
41
+ proxy_set_header Connection $connection_upgrade;
42
+ }
43
+
44
+ }
45
+
46
+ server {
47
+
48
+ server_name *.${DOMAIN};
49
+ listen [::]:80;
50
+ listen 80;
51
+
52
+ return 301 https://$host$request_uri;
53
+
54
+ }
You can’t perform that action at this time.
0 commit comments