forked from krisrang/dokku-domains
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf.erb
42 lines (38 loc) · 1.12 KB
/
nginx.conf.erb
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
upstream <%= app %> { server 127.0.0.1:<%= port %>; }
<% if use_ssl %>
server {
listen [::]:80;
listen 80;
server_name <%= hostname %>;
return 301 https://$host$request_uri;
}
<% end %>
server {
<% if use_ssl %>
listen [::]:443;
listen 443;
<% else %>
listen [::]:80;
listen 80;
<% end %>
server_name <%= hostname %>;
<% if use_ssl %>
ssl on;
ssl_certificate <%= File.join(ssl, 'server.crt') %>;
ssl_certificate_key <%= File.join(ssl, 'server.key') %>;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-RC4-SHA:ECDHE-RSA-AES128-SHA:AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!CAMELLIA;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
ssl_prefer_server_ciphers on;
<% end %>
location / {
proxy_pass http://<%= app %>;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Request-Start $msec;
}
}