-
Notifications
You must be signed in to change notification settings - Fork 0
/
irtwitch.fun.conf
203 lines (171 loc) · 6.15 KB
/
irtwitch.fun.conf
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
server {
server_name xxxxxxxxxxxx.fun;
root /var/www/irtw/public;
client_max_body_size 1M;
autoindex off;
index index.html index.htm index.php;
access_log off;
server_tokens off;
location ~ ^/errors/(400|401|403|404|405|500)\.html$ {
root /var/www/irtw/public;
internal;
}
error_page 400 /errors/400.html;
error_page 401 /errors/401.html;
error_page 403 /errors/403.html;
error_page 404 /errors/404.html;
error_page 404 /errors/405.html;
error_page 500 /errors/500.html;
location ~ /\.(htaccess|env|git|svn|env|git|artisan|composer\.(json|lock)|README\.md)$ {
deny all;
return 404;
}
location ~ ^/(vendor|storage|config|secrets|bootstrap|database)/ {
deny all;
return 404;
}
location = /config.php {
deny all;
return 404;
}
location ~* \.(js|css|svg|ico|woff|woff2|ttf|map)$ {
expires max;
add_header Cache-Control "public, no-transform";
}
location ~ ^/(uploads|template)/ {
expires max;
add_header Cache-Control "public, no-transform";
}
location /chat_service/server {
access_log off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy false;
proxy_pass http://localhost:6032;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location ~ ^/live_streams/(stream|ostream|playlist)/(.*).(m3u8|php|js|css)$ {
root /var/www/irtw_cdn;
access_log off;
if (!-e $request_filename) {
rewrite ^/live_streams/(stream|ostream|playlist)/(.*).(m3u8|php|js|css)$ /live_streams/$1.php?username=$2 last;
}
}
location ~ ^/live_streams/segments/(.*).(php|js|mp4|css)$ {
root /var/www/irtw_cdn;
access_log off;
expires 300s;
log_not_found off;
add_header Cache-Control public;
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers GET;
add_header Vary: Origin;
tcp_nodelay off;
open_file_cache max=3000 inactive=300s;
open_file_cache_valid 45s;
open_file_cache_min_uses 1;
open_file_cache_errors off;
if (!-e $request_filename){
rewrite ^/live_streams/segments/(.*).(php|js|mp4|css) /live_streams/segments/$1.ts;
}
}
location ~ ^/live_streams/segments/(.*).ts$ {
root /var/www/irtw_cdn;
access_log off;
expires 300s;
log_not_found off;
add_header Cache-Control public;
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers GET;
add_header Vary: Origin;
tcp_nodelay off;
open_file_cache max=3000 inactive=300s;
open_file_cache_valid 45s;
open_file_cache_min_uses 1;
open_file_cache_errors off;
if (!-e $request_filename){
rewrite ^/live_streams/segments/(.*) /live_streams/ts.php?ts=$1;
}
}
location ~ ^/live_streams/(stream|ostream|playlist|ts).php$ {
root /var/www/irtw_cdn;
access_log off;
try_files $uri =404;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
}
location ~ /chat_emoji/(7tv|betterttv|betterttv_frankerfacez|twemoji|twitch|emojies)/(.*)$ {
root /var/www/irtw_cdn;
access_log off;
expires max;
add_header Cache-Control "public, no-transform";
if (!-e $request_filename) {
rewrite /chat_emoji/(7tv|betterttv|betterttv_frankerfacez|twemoji|twitch|emojies)/(.*) /chat_emoji/$1/index.php?masterkingurlis=$2;
}
location ~* \.php$ {
try_files $uri =404;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
}
}
location /images {
root /var/www/irtw_cdn;
access_log off;
expires 300s;
log_not_found off;
add_header Cache-Control public;
tcp_nodelay off;
open_file_cache max=3000 inactive=300s;
open_file_cache_valid 45s;
open_file_cache_min_uses 1;
open_file_cache_errors off;
try_files $uri $uri/ /images/mk_downloader.php?url=$uri;
location ~* \.php$ {
try_files $uri =404;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
}
}
location ~ \.php$ {
try_files $uri @SendtoFramework;
access_log off;
include fastcgi_params;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
}
location @SendtoFramework {
try_files $uri $uri/ /index.php?$query_string;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/xxxxxxxxxxxx.fun/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/xxxxxxxxxxxx.fun/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 = xxxxxxxxxxxx.fun) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name xxxxxxxxxxxx.fun;
listen 80;
return 404; # managed by Certbot
}