-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx-vhost.conf.sample
59 lines (44 loc) · 1.53 KB
/
nginx-vhost.conf.sample
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
## THIS DEFAULT NGINX HOST CONFIGURATION
server {
listen 80;
#### IF USE HTTPS
# listen 443 ssl http2;
# ssl_certificate /path/to/certificate.crt
# ssl_certificate_key /path/to/certificate.key
#### ROOT DIRECTORY
root /path/to/root/public;
### FILE INDEX
index index.php;
#### HOST
server_name api.example.com;
#### DISABLE LOG
# error_log off; # uncomment this to disable error logging
log_not_found off; # log not found is not important
access_log off; # log access is not important
### Query For File Index
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
### PHP handler
location ~ \.php {
#### try below to handle all 404 not found with script
try_files $uri $uri/ /index.php$is_args$args;
#### Fast CGI
fastcgi_split_path_info ^(.+\.php)(/.+)$;
#### include default configuration nginx fastcgi_params
include fastcgi_params;
#### environment php file name
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_index index.php;
#### BELOW IS PASS FAST CGI
#### CHANGE with php fpm listen host:port or maybe socket with unix://path/to/socket.sock
####
fastcgi_pass 127.0.0.1:9000;
#### use intercept error
fastcgi_intercept_errors off;
#### buffer size
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
}
}