forked from SCAULUG/Mirrors-Nginx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
70 lines (55 loc) · 1.82 KB
/
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
65
66
67
68
69
70
user nginx;
worker_processes 1;
error_log /dev/stderr warn;
pid /tmp/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
charset_types text/css text/plain application/javascript application/json;
log_format main '$http_x_forwarded_for - $remote_user [$time_local] '
'"$request_method $scheme://$host$request_uri '
'$server_protocol" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_time';
access_log /dev/stdout main;
sendfile on;
#gzip on;
server {
listen 80;
server_name mirrors.scau.edu.cn;
root /mirrors/;
index index.html index.htm;
rewrite ^/(.*)$ https://$host/$1 permanent;
}
# HTTPS server
#
server {
listen 443 ssl;
server_name mirrors.scau.edu.cn;
ssl on;
ssl_certificate /ssl/mirrors.crt;
ssl_certificate_key /ssl/mirrors.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_prefer_server_ciphers on;
root /mirrors/;
index index.html index.htm;
location /{
alias /Mirrors-Index/;
}
location ~ ^/(archlinux|centos|debian|deepin-cd|docker-hub|epel|linuxmint-cd|raspbian|raspberrypi|ubuntu-cdimage|ubuntu) {
fancyindex on;
fancyindex_exact_size on;
fancyindex_header "/fancy-header.html";
fancyindex_footer "/fancy-footer.html";
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}