-
Notifications
You must be signed in to change notification settings - Fork 2
/
config-scaffold.conf
42 lines (33 loc) · 1.15 KB
/
config-scaffold.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
server {
listen 80;
listen [::]:80;
server_name example.com;
root /var/www/example;
error_log /var/log/nginx/example.error.log;
access_log /var/log/nginx/example.access.log;
index index.php index.html index.htm;
charset utf-8;
try_files $uri $uri/ /index.php$is_args$args;
error_page 404 = /404;
# Removes trailing slashes (prevents SEO duplicate content issues)
if (!-d $request_filename) {
rewrite ^/(.+)/$ /$1 permanent;
}
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
location ~ /\. { return 404; }
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PHP_VALUE "
display_startup_errors = 0
display_errors = 0
log_errors = 1
error_log = /var/log/nginx/example.php-error.log
date.timezone = UTC
";
fastcgi_param HTTPS off;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}