-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathnginx.conf
66 lines (54 loc) · 1.56 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
server {
listen 8000 default_server;
listen [::]:8000 default_server;
server_name _;
# Add index.php to setup Nginx, PHP & PHP-FPM config
index index.php index.html index.htm index.nginx-debian.html;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www/html/public;
# pass PHP scripts on Nginx to FastCGI (PHP-FPM) server
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# Nginx php-fpm config:
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
client_max_body_size 15M;
server_tokens off;
# Hide PHP headers
fastcgi_hide_header X-Powered-By;
fastcgi_hide_header X-CF-Powered-By;
fastcgi_hide_header X-Runtime;
location / {
try_files $uri $uri/ /index.php?$query_string;
gzip_static on;
}
location ~ \.css {
add_header Content-Type text/css;
}
location ~ \.js {
add_header Content-Type application/x-javascript;
}
# deny access to Apache .htaccess on Nginx with PHP,
# if Apache and Nginx document roots concur
location ~ /\.ht {
deny all;
}
location ~ /\.svn/ {
deny all;
}
location ~ /\.git/ {
deny all;
}
location ~ /\.hg/ {
deny all;
}
location ~ /\.bzr/ {
deny all;
}
}