-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
131 lines (106 loc) · 3.49 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
user nginx;
worker_processes auto;
worker_cpu_affinity auto;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid run/nginx.pid;
worker_rlimit_nofile 655360;
events {
use epoll;
worker_connections 102400;
multi_accept on;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" "$request_body" "$request_time" "$status"';
access_log logs/access.log main buffer=16k;
keepalive_timeout 65;
keepalive_requests 100000;
fastcgi_hide_header X-Powered-By;
fastcgi_hide_header X-Runtime;
fastcgi_hide_header X-Version;
fastcgi_connect_timeout 300;
fastcgi_read_timeout 300;
fastcgi_send_timeout 300;
fastcgi_buffer_size 16k;
fastcgi_buffers 16 16k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;
open_file_cache max=655360 inactive=60s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
client_header_buffer_size 1k;
client_body_buffer_size 1024k;
client_max_body_size 50M;
client_header_timeout 15;
client_body_timeout 15;
send_timeout 65;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
reset_timedout_connection on;
gzip on;
gzip_static on;
gzip_proxied expired no-cache no-store private auth;
gzip_min_length 1k;
gzip_buffers 32 4k;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary off;
gzip_disable "MSIE [1-6]\.";
gunzip on;
gunzip_buffers 32 4k;
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm index.php;
autoindex off;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
}
}
#location ~ \.php$ {
location ~ ^.+\.php {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $DOCUMENT_ROOT$fastcgi_path_info;
#fastcgi_param SCRIPT_FILENAME $DOCUMENT_ROOT/index.php;
fastcgi_param SCRIPT_FILENAME $DOCUMENT_ROOT$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
#if ( $host != 'www.abc.com') {
# return 404;
#}
}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# ssl_ciphers ALL:HIGH:!NULL:!aNULL:!eNULL:!EXPORT:!MD5:!PSK:!RC4:!3DES:!ADH:!EXPORT56;
# ssl_prefer_server_ciphers on;
# ssl_session_cache shared:SSL:10m;
# ssl_session_timeout 5m;
# ssl_stapling on;
# location / {
# root html;
# index index.html index.htm index.php;
# }
#}
}