-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnginx.conf
76 lines (60 loc) · 1.76 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
user www-data;
events {
worker_connections 2048;
use epoll;
}
http {
real_ip_header X-Forwarded-For;
real_ip_recursive on;
set_real_ip_from 0.0.0.0/0;
keepalive_requests 5000;
keepalive_timeout 3600;
send_timeout 3600;
proxy_read_timeout 3600;
proxy_connect_timeout 3600;
proxy_send_timeout 3600;
client_max_body_size 32m;
client_body_buffer_size 32m;
sendfile on;
server_tokens off;
tcp_nopush on;
tcp_nodelay on;
reset_timedout_connection on;
gzip on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied any;
gzip_types application/javascript application/json application/xml text/css text/plain text/xml;
gzip_vary on;
open_file_cache max=1000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
upstream php-fpm {
server 127.0.0.1:9000 max_fails=5 fail_timeout=5s;
}
server {
listen 80;
server_name localhost;
server_tokens off;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Frame-Options "SAMEORIGIN";
root /var/www/public;
index index.php;
access_log /dev/stdout;
error_log /dev/stderr info;
include /etc/nginx/mime.types;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass php-fpm;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_read_timeout 3600s;
include fastcgi_params;
}
}
}