-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf.txt
53 lines (50 loc) · 1.54 KB
/
nginx.conf.txt
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
### BuyITCart Settings ###
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Make sure files with the following extensions do not get loaded by nginx because nginx would
# display the source code, and these files can contain PASSWORDS!
location ~* \.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|\.php_ {
deny all;
}
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
### Retina images handler. Check cookie and looking for file with @2x at the end of name
location ~* ^(.*)\.(jpg|jpeg|png|gif)$ {
set $hidpi_uri [email protected];
if ($http_cookie !~ 'HTTP_IS_RETINA=1') {
break;
}
try_files $hidpi_uri $uri =404;
}
location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ {
expires max;
log_not_found off;
}
location ~ /(system/logs|resources/download) {
deny all;
return 403;
}
location /admin/ {
location ~ .*\.(php)?$ {
deny all;
return 403;
}
}
#rewrite for images for retina-displays
location ~ / {
if (!-e $request_filename){
rewrite ^/(.*)\?*$ /index.php?_route_=$1 last;
}
}
### End of BuyITCart settings ###