forked from ndeet/pete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslim_nginx_vhost
42 lines (32 loc) · 1.38 KB
/
slim_nginx_vhost
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
## file location: /etc/nginx/sites-available/slim
server {
listen 80; # IPv4
## Internal domain or _ to match all.
server_name pete-slim.pi;
client_max_body_size 100M;
## Access and error logs.
# Disable access log to not interfere performance on many requests.
#access_log /var/log/nginx/slim-access.log;
error_log /var/log/nginx/slim-error.log;
## Filesystem root of the site and index.
root /var/www/pete/slim;
index index.php;
try_files $uri /index.php;
# Directives to send expires headers and turn off 404 error logging.
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
access_log off; log_not_found off; expires max;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/php5-fpm.sock;
## PHP 7 fpm socket. Commented as we use the PHP 5 socket above.
#fastcgi_pass unix:/var/run/php7-fpm.sock;
## Used TCP connection before but ran into open ports issue. You will need
## to adjust phpX-fpm/www.conf (listen) to match this.
#fastcgi_pass 127.0.0.1:9000; #php 5.6
#fastcgi_pass 127.0.0.1:8999; #php 7.0.1
}
fastcgi_keep_conn on; # keep alive to the FCGI upstream
}