-
Notifications
You must be signed in to change notification settings - Fork 1
/
sift.pics.nginx
96 lines (70 loc) · 2.01 KB
/
sift.pics.nginx
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
# Expires map
map $sent_http_content_type $expires {
default off;
text/html epoch;
text/css max;
application/javascript max;
~image/ max;
}
server {
listen 80;
server_name sift.pics;
access_log /var/log/sift.pics.access.log;
error_log /var/log/sift.pics.error.log;
expires $expires;
if ($host !~* ^(sift.pics|www.sift.pics)$ ) {
return 444;
}
location /media {
alias /home/ajapaik/sift-pics-web/media;
}
location /static {
alias /home/ajapaik/sift-pics-web/static-collected;
}
location ~ ^/favicon.(\w*)$ {
alias /home/ajapaik/sift-pics-web/static-collected/favicon.$1;
}
location / {
include uwsgi_params;
uwsgi_pass unix:/home/ajapaik/sift-pics-web/run/sift.pics.sock;
}
}
server {
listen 80;
server_name www.sift.pics;
return 301 https://sift.pics$request_uri;
}
server {
listen 443;
server_name www.sift.pics;
ssl on;
ssl_certificate /etc/letsencrypt/live/sift.pics/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/sift.pics/privkey.pem;
return 301 https://sift.pics$request_uri;
}
server {
listen 443;
server_name sift.pics;
ssl on;
ssl_certificate /etc/letsencrypt/live/sift.pics/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/sift.pics/privkey.pem;
access_log /var/log/sift.pics.access.log;
error_log /var/log/sift.pics.error.log;
expires $expires;
if ($host !~* ^(sift.pics|www.sift.pics)$ ) {
return 444;
}
location /media {
alias /home/ajapaik/sift-pics-web/media;
}
location /static {
alias /home/ajapaik/sift-pics-web/static-collected;
}
location ~ ^/favicon.(\w*)$ {
alias /home/ajapaik/sift-pics-web/static-collected/favicon.$1;
}
location / {
include uwsgi_params;
uwsgi_pass unix:/home/ajapaik/sift-pics-web/run/sift.pics.sock;
}
}