-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproduction
More file actions
executable file
·95 lines (78 loc) · 3.04 KB
/
Copy pathproduction
File metadata and controls
executable file
·95 lines (78 loc) · 3.04 KB
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
# //////////////////////
# www.unknownanalytics.com
# ///////////////////////
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream puma_unk {
server localhost:3005;
}
server {
server_name www.unknownanalytics.com unknownanalytics.com;
# deny requests for files that should never be accessed
location ~ /\. {
deny all;
}
location ~* ^.+\.(rb|log)$ {
deny all;
}
location /cable {
proxy_pass http://puma_unk/cable;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
# serve static (compiled) assets directly if they exist (for rails production)
location ~ ^/(assets|images|javascripts|stylesheets|swfs|system)/ {
root /var/www/unk-ana-assets;
try_files $uri @puma_unk ;
access_log off;
gzip_static on; # to serve pre-gzipped version
expires max;
add_header Cache-Control public;
add_header Last-Modified "";
add_header ETag "";
break;
}
location /sdk.js {
alias /var/www/unk-ana-assets/assets/sdk.js;
gzip_static on; # to serve pre-gzipped version
add_header Cache-Control public;
add_header Last-Modified "";
add_header ETag "";
break;
}
# send non-static file requests to the app server
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-Port $server_port;
proxy_set_header X-Real-Scheme $scheme;
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://puma_unk;
}
if ($host = 'unknownanalytics.com') {
return 301 https://www.unknownanalytics.com$request_uri;
}
listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/www.380squares.xyz/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/www.380squares.xyz/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = unknownanalytics.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = www.unknownanalytics.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name unknownanalytics.com www.unknownanalytics.com;
listen 80;
return 404; # managed by Certbot
}