forked from HCF3263827/ruqqus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.txt
59 lines (44 loc) · 1.56 KB
/
nginx.txt
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
server {
server_name dev.ruqqus.com chat.ruqqus.com ruqqus.com ruqq.us c.ruqq.us ruqqus.org ruqqus.win *.amazonaws.com cc5j4aqdgznut4ns.onion;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 64m;
listen 80;
listen [::]:80;
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /etc/letsencrypt/live/aws.ruqqus.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/aws.ruqqus.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
if ($host = www.ruqqus.com){
return 301 https://ruqqus.com$request_uri;
}
if ($host = ruqq.us) {
return 301 https://ruqqus.com/post_short$request_uri;
}
if ($host = c.ruqq.us) {
return 301 https://ruqqus.com/comment$request_uri;
}
if ($host = ruqqus.win) {
return 301 https://ruqqus.com;
}
if ($host = *.amazonaws.com) {
return 404;
}
location /socket.io {
proxy_pass http://127.0.0.1:5001;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# add_header Access-Control-Allow-Origin https://ruqqus.com;
}
location / {
proxy_pass http://127.0.0.1:5000;
add_header Permissions-Policy interest-cohort=();
}
error_page 502 =500 /error_page/503.html;
location /error_page/ {
alias /home/ubuntu/ruqqus/ruqqus/templates/errors/;
}
}