-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathnginx_none_ssl.conf
48 lines (41 loc) · 1.62 KB
/
nginx_none_ssl.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
# Please replace "yoursite.com" -> your domain
server {
listen 80;
charset UTF-8;
server_name www.yoursite.com;
set $root_path '/home/yoursite/public';
root $root_path;
#access_log /var/log/nginx/yoursite.com-access.log;
#error_log /var/log/nginx/yoursite.com-error.log;
index index.php index.html index.htm;
location = /robots.txt { access_log off; log_not_found off; }
location ~ /\. { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
location ~ /\.git { access_log off; log_not_found off; deny all; }
location ~ /\.ideal { access_log off; log_not_found off; deny all; }
location = /nginx_ssl.conf { access_log off; log_not_found off; deny all; }
location = /nginx_none_ssl.conf { access_log off; log_not_found off; deny all; }
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index /index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
#d = day, w = week, m = month, y = year
expires 7d;
add_header Pragma public;
add_header Cache-Control "public";
}
location ~ /\.ht {
deny all;
}
}