This repository has been archived by the owner on Jun 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathassets.fastgit.org.conf
81 lines (67 loc) · 2.68 KB
/
assets.fastgit.org.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
server {
listen 443 ssl http2;
server_name assets.fastgit.org;
root /www/wwwroot/fg;
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate /var/www/cert/fg.pem;
ssl_certificate /var/www/cert/fg.pem;
ssl_certificate_key /var/www/cert/fg.key;
# Run following command & set permission before configuring
# curl https://ssl-config.mozilla.org/ffdhe2048.txt > /var/lib/nginx/dhparam.pem
ssl_dhparam /var/lib/nginx/dhparam.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 60m;
ssl_session_tickets off;
error_page 497 https://$host$request_uri;
include /etc/nginx/snippets/anti-floc.conf;
# SSL
location ~ \.well-known {
allow all;
}
# Fuck Search Engine
location /robots.txt {
allow all;
}
#PROXY-START/
location ~* \.(php|jsp|cgi|asp|aspx)$
{
proxy_pass https://github.githubassets.com;
proxy_set_header Host github.githubassets.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
}
location /
{
proxy_pass https://github.githubassets.com;
proxy_set_header Host github.githubassets.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
add_header X-Cache $upstream_cache_status;
proxy_ignore_headers Set-Cookie Cache-Control expires;
# proxy_cache cache_one;
proxy_cache_key $host$uri$is_args$args;
proxy_cache_valid 200 304 301 302 480m;
expires 12h;
}
# Block search engine
# if ($http_user_agent ~* "qihoobot|Baiduspider|Bingbot|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot")
# {
# return 403;
# }
# Anti Agent Bot DDoS
# If behind CDN, use folloing commented code
# if ($http_x_forwarded_for != $remote_addr) {
# return 503;
# }
if ($proxy_add_x_forwarded_for != $remote_addr) {
return 503;
}
access_log /www/wwwlogs/assets.fastgit.org.log;
error_log /www/wwwlogs/assets.fastgit.org.error.log;
}