-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
72 lines (57 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
error_log /tmp/nginx/nginx-error.log warn;
pid /var/run/nginx.pid;
worker_processes 1;
events {
worker_connections 1024;
use epoll;
multi_accept on;
}
user nginx www-data;
http {
## MIME Types
default_type application/octet-stream;
include /etc/nginx/mime.types;
## Logging
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
## Compression
# Enable gzip. Highly recommending for best peformance
gzip on;
gzip_comp_level 3;
gzip_types text/html text/css text/javascript application/json application/javascript application/x-javascript;
server {
listen 80;
listen [::]:80;
server_name localhost;
index index.html index.php;
disable_symlinks off;
location ~ \.php$ {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php-fpm8.sock;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fastcgi_read_timeout 300s;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
## Optional: set long EXPIRES header on static assets
location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
expires 30d;
## Optional: Don't log access to assets
access_log off;
}
}
}