-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample.nginx.conf
64 lines (47 loc) · 1.73 KB
/
sample.nginx.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
daemon off;
events {
worker_connections 1024;
}
http {
include /usr/local/nginx/conf/mime.types;
server {
listen [::]:80;
root #insert path to head folder
add_header X-Content-Type-Options "nosniff" always;
add_header Content-Security-Policy "default-src 'self'; object-src 'none'; media-src *; style-src 'self' 'unsafe-inline'" always;
add_header X-Frame-Options DENY;
# replace <password> with password stored in cookie
set $postpass password;
if ($cookie_post_pass) {
set $postpass $cookie_post_pass;
}
subs_filter <password> $postpass o;
# replace default with theme stored in cookie
set $theme default;
if ($cookie_theme) {
set $theme $cookie_theme;
}
subs_filter default $theme o;
# replace 6 with how many banners you have
set_random $banner 1 6;
subs_filter cbanner $banner o;
location ~* .(?:css|js|txt|woff2|webp|jpg|jpeg|gif|png|avif|mp3|ogg|opus|flac|webm|mp4)$ {
expires max;
add_header Cache-Control "public";
add_header X-Content-Type-Options "nosniff" always;
add_header Content-Security-Policy "default-src 'self'" always;
}
location ~* .(?:html)$ {
add_header Cache-Control "private";
add_header X-Content-Type-Options "nosniff" always;
}
client_max_body_size 15m;
location /resources/banners/ {
autoindex on;
}
location /im/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:1024;
}
}
}