-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
38 lines (31 loc) · 1.31 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
upstream demo-xuexb-com {
server demo-xuexb-com:8080;
}
server {
server_name demo.xuexb.com github.xuexb.com;
include inc/ssl.conf;
ssl_certificate ca/xuexb.com/fullchain.cer;
ssl_certificate_key ca/xuexb.com/xuexb.com.key;
if ( $host != 'demo.xuexb.com' ){
rewrite ^/(.*)$ https://demo.xuexb.com/$1 permanent;
}
brotli on;
brotli_comp_level 6;
brotli_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml;
add_header 'X-XSS-Protection' '1; mode=block';
add_header 'X-Frame-Options' 'SAMEORIGIN';
add_header 'X-Content-Type-Options' 'nosniff';
add_header 'X-DNS-Prefetch-Control' 'on';
# 上报日志
access_log syslog:server=kibana-fluentd:8989,tag=demo_xuexb_com Fluentd;
error_log syslog:server=kibana-fluentd:8988,tag=demo_xuexb_com error;
location / {
proxy_set_header Connection "";
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 true;
proxy_pass http://demo-xuexb-com$request_uri;
proxy_redirect off;
}
}