forked from ViStefan/ngk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf.example
115 lines (93 loc) · 3.42 KB
/
nginx.conf.example
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
server {
listen 80;
server_name gcode.space;
gzip on;
gzip_types text/plain application/xml application/json;
gzip_proxied no-cache no-store private expired auth;
access_log /var/log/nginx/ngk/access.log;
error_log /var/log/nginx/ngk/error.log error;
root /home/python/ngk/static;
add_header "Content-Security-Policy" "default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src * data:" always;
add_header "X-XSS-Protection" "1; mode=block" always;
add_header "X-Frame-Options" "sameorigin" always;
add_header "X-Content-Type-Options" "nosniff" always;
add_header "Feature-Policy" "microphone 'none'; geolocation 'none'; camera 'none'" always;
add_header "Referrer-Policy" "same-origin" always;
add_header "Permissions-Policy" "interest-cohort=()" always;
etag on;
if_modified_since exact;
add_header Pragma "public";
add_header Cache-Control "max-age=31536000, public";
location / {
index index.html;
}
location /db_dumps/ {
root /home/python/ngk;
autoindex on;
}
location = /favicon.ico {
root /home/python/ngk/static/img;
}
location /.well-known {
root /home/python/ngk/static;
}
location = /robots.txt {
root /home/python/ngk/static;
}
location = /socket.io/ {
gunzip on;
add_header Pragma "";
add_header Cache-Control "no-cache, no-store, must-revalidate";
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_cache_bypass $http_upgrade;
proxy_pass http://127.0.0.1:1234/socket.io/;
}
location /api {
gunzip on;
add_header Pragma "";
add_header Cache-Control "";
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_cache_bypass $http_upgrade;
proxy_pass http://127.0.0.1:1234/;
}
location /phpmyadmin {
return 301 https://www.youtube.com/watch?v=dQw4w9WgXcQ;
}
location /wp-admin {
return 301 https://www.youtube.com/watch?v=dQw4w9WgXcQ;
}
location /wp-login.php {
return 301 https://www.youtube.com/watch?v=dQw4w9WgXcQ;
}
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/12;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2c0f:f248::/32;
set_real_ip_from 2a06:98c0::/29;
real_ip_header CF-Connecting-IP;
}