-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
181 lines (143 loc) · 4.98 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# web service config.
server {
listen 80;
listen [::]:80;
server_name almondhydroponics.com www.almondhydroponics.com;
return 301 https://almondhydroponics.com$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name almondhydroponics.com www.almondhydroponics.com;
server_tokens off;
ssl_certificate /etc/ssl/cloudflare/cert.pem;
ssl_certificate_key /etc/ssl/cloudflare/key.pem;
access_log /var/log/nginx/data-access.log combined;
location / {
include /etc/nginx/proxy.conf;
proxy_pass http://web:3000/;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
# enable strict transport security only if you understand the implications
}
}
# api service config.
server {
listen 80;
listen [::]:80;
server_name api.almondhydroponics.com www.api.almondhydroponics.com;
return 301 https://api.almondhydroponics.com$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name api.almondhydroponics.com www.api.almondhydroponics.com;
server_tokens off;
ssl_prefer_server_ciphers On;
ssl_protocols TLSv1.2;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_ciphers AES256+EECDH:AES256+EDH:!aNULL;
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
ssl_certificate /etc/ssl/cloudflare/cert.pem;
ssl_certificate_key /etc/ssl/cloudflare/key.pem;
access_log /var/log/nginx/data-access.log combined;
error_log /var/log/nginx/error.log error;
location / {
include /etc/nginx/proxy.conf;
proxy_pass http://api:8080;
}
}
# dashboard service config.
server {
listen 80;
listen [::]:80;
server_name dashboard.almondhydroponics.com www.dashboard.almondhydroponics.com;
return 301 https://dashboard.almondhydroponics.com$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name dashboard.almondhydroponics.com www.dashboard.almondhydroponics.com;
server_tokens off;
ssl_prefer_server_ciphers On;
ssl_protocols TLSv1.2;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_ciphers AES256+EECDH:AES256+EDH:!aNULL;
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
ssl_certificate /etc/ssl/cloudflare/cert.pem;
ssl_certificate_key /etc/ssl/cloudflare/key.pem;
access_log /var/log/nginx/data-access.log combined;
error_log /var/log/nginx/error.log error;
location / {
include /etc/nginx/proxy.conf;
proxy_pass http://dashboard:3001;
}
}
# wordpress service config.
server {
listen 80;
listen [::]:80;
server_name wordpress.almondhydroponics.com www.wordpress.almondhydroponics.com;
return 301 https://wordpress.almondhydroponics.com$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name wordpress.almondhydroponics.com www.wordpress.almondhydroponics.com;
server_tokens off;
ssl_prefer_server_ciphers On;
ssl_protocols TLSv1.2;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_ciphers AES256+EECDH:AES256+EDH:!aNULL;
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
ssl_certificate /etc/ssl/cloudflare/cert.pem;
ssl_certificate_key /etc/ssl/cloudflare/key.pem;
access_log /var/log/nginx/data-access.log combined;
error_log /var/log/nginx/error.log error;
location / {
include /etc/nginx/proxy.conf;
proxy_pass http://wordpress:80;
}
}
# influxdb service config.
server {
listen 80;
listen [::]:80;
server_name influxdb.almondhydroponics.com www.influxdb.almondhydroponics.com;
return 301 https://influxdb.almondhydroponics.com$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name influxdb.almondhydroponics.com www.influxdb.almondhydroponics.com;
server_tokens off;
ssl_prefer_server_ciphers On;
ssl_protocols TLSv1.2;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_ciphers AES256+EECDH:AES256+EDH:!aNULL;
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
ssl_certificate /etc/ssl/cloudflare/cert.pem;
ssl_certificate_key /etc/ssl/cloudflare/key.pem;
access_log /var/log/nginx/data-access.log combined;
error_log /var/log/nginx/error.log error;
location / {
include /etc/nginx/proxy.conf;
proxy_pass http://influxdb:8086;
}
}