forked from combro2k/nginx-proxy-pagespeed
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathnginx.conf
110 lines (94 loc) · 3.64 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
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
user www-data;
worker_processes 4;
worker_rlimit_nofile 8192;
#worker_cpu_affinity 0001 0010 0100 1000;
pid /run/nginx.pid;
error_log /var/log/nginx/error.log;
events {
multi_accept on;
worker_connections 4096;
}
http {
log_format '$host - $remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" "$gzip_ratio"';
map_hash_bucket_size 128;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
keepalive_requests 100;
### timeouts ###
resolver_timeout 6;
client_header_timeout 30;
client_body_timeout 60;
send_timeout 60;
### buffers ###
client_header_buffer_size 1k;
client_body_buffer_size 128k;
large_client_header_buffers 4 4k;
client_max_body_size 10m;
client_body_temp_path /tmp/nginx_client;
output_buffers 1 32k;
postpone_output 1460;
server_names_hash_bucket_size 64;
server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
error_log /data/logs/error.log;
access_log /data/logs/access.log;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_min_length 128;
gzip_buffers 128 32k;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/css text/x-component
text/xml application/xml application/xhtml+xml application/json
image/x-icon image/bmp image/svg+xml application/atom+xml
text/javascript application/javascript application/x-javascript
application/pdf application/postscript
application/rtf application/msword
application/vnd.ms-powerpoint application/vnd.ms-excel
application/vnd.ms-fontobject application/vnd.wap.wml
application/x-font-ttf application/x-font-opentype;
### proxy-global ###
proxy_intercept_errors on; # testing=off
proxy_ignore_client_abort off;
proxy_redirect http:// $scheme://;
### proxy-header ###
proxy_set_header Accept-Encoding "";
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-By $server_addr:$server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-Class $classification; # custom
proxy_set_header X-Forwarded-Proto $scheme;
map $scheme $msiis { http off; https on; }
proxy_set_header Front-End-Https $msiis;
### proxy-timeouts ###
proxy_connect_timeout 6;
proxy_send_timeout 60;
proxy_read_timeout 60;
### proxy-buffers ###
proxy_buffering on;
proxy_buffer_size 8k;
proxy_buffers 256 8k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
proxy_temp_path /tmp/nginx_temp/;
### global ###
ignore_invalid_headers on;
if_modified_since before;
#root /etc/nginx/content/;
ssi on;
ssi_silent_errors on; # testing=off
add_header X-Frame-Options SAMEORIGIN;
add_header Strict-Transport-Security max-age=3456000;
include /data/config/proxy.conf;
}
daemon off;