blob: 1a32b6d38995b994df725e2043354577e349d3a7 (
plain)
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
|
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name ${CRUPEST_DOMAIN};
location / {
root /srv/www;
}
location /_$CRUPEST_V2RAY_PATH {
if ($http_upgrade != "websocket") {
return 404;
}
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://v2ray:10000;
}
location /api {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://crupest-api:5000;
}
}
server {
listen 80;
listen [::]:80;
server_name ${CRUPEST_DOMAIN};
location / {
return 301 https://$host$request_uri;
}
location /.well-known/acme-challenge {
root /srv/acme;
}
}
# Temporary config for roundcubemail (PHP)
# TODO: Add to nginx template.
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name mail.${CRUPEST_DOMAIN};
index index.php index.html;
root /srv/roundcubemail;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass roundcubemail:9009;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
server {
listen 80;
listen [::]:80;
server_name mail.${CRUPEST_DOMAIN};
location / {
return 301 https://$host$request_uri;
}
location /.well-known/acme-challenge {
root /srv/acme;
}
}
|