-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathBitrix
114 lines (113 loc) · 4.6 KB
/
Bitrix
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
php-------------------------------------------------------------------------------------------------------------------------------------------------------------
short_open_tag=On
opcache.max_accelerated_files=100000
opcache.revalidate_freq=0
opcache.memory_consumption=128
opcache.fast_shutdown=1
opcache.force_restart_timeout=60
opcache.file_update_protection=10
max_input_vars=10000
pcre.jit=0
upload_max_filesize=5M
post_max_size=5M
memory_limit=256M
date.timezone=Europe/Moscow
session.gc_probability=1
;allow_url_fopen = Off
php-------------------------------------------------------------------------------------------------------------------------------------------------------------
nginx-------------------------------------------------------------------------------------------------------------------------------------------------------------
client_max_body_size 5m;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header Strict-Transport-Security "max-age=31536000; preload;";
if ($request_uri ~ ^([^\?]*)/index\.(html|php)) { return 308 $1/$is_args$args; }
location = /bitrix/redirect.php { internal; }
location = /bitrix/rk.php { internal; }
location / {
try_files $uri $uri/ /bitrix/urlrewrite.php$is_args$args;
location ~ ^/bitrix/tools/(vote/uf|html_editor_action)\.php$ {
if ($request_method = POST) { return 404; }
try_files return @php;
}
location ~ /\.default/.+ {
access_log off;
log_not_found off;
location ~ \.php$ {
try_files /f5debce384416c95c84c8122354ed680.htm @php;
}
location ~* ^.+\.(jpe?g|png|tiff|gif|webp|xml|html|yml|ogg|ogv|svg|svgz|eot|otf|woff|woff2|mp4|ttf|rss|atom|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|rtf|pdf|txt|js|css|bmp|pnm|pbm|ppm)$ {
access_log off;
expires 97d;
}
}
location ~* ^.+\.(jpe?g|png|tiff|gif|webp|xml|yml|ogg|ogv|svg|svgz|eot|otf|woff|woff2|mp4|ttf|rss|atom|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|rtf|pdf|txt|js|css|bmp|pnm|pbm|ppm)$ {
access_log off;
expires 97d;
}
location ~* @.*\.html$ { internal; }
}
location ^~ /bitrix/modules { internal; }
location ^~ /bitrix/php_interface { internal; }
location ^~ /local/templates/ {
location ~ /\.default/.+ {
access_log off;
log_not_found off;
location ~ \.php$ {
try_files /f5debce384416c95c84c8122354ed680.htm @php;
}
location ~* ^.+\.(jpe?g|png|tiff|gif|webp|xml|html|yml|ogg|ogv|svg|svgz|eot|otf|woff|woff2|mp4|ttf|rss|atom|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|rtf|pdf|txt|js|css|bmp|pnm|pbm|ppm)$ {
access_log off;
expires 97d;
}
}
location ~ /\. { internal; }
location ~* [^/]\.(jpe?g|png|tiff|gif|webp|xml|yml|ogg|ogv|svgz?|eot|otf|woff2?|mp4|ttf|rss|atom|ico|zip|t?gz|rar|bz2|doc|xls|exe|ppt|tar|midi?|wav|rtf|pdf|txt|js|css|bmp|pnm|pbm|ppm)$ {
access_log off;
expires 97d;
}
location ~ \.php$ {
try_files /f5debce384416c95c84c8122354ed680.htm @php;
}
}
location ^~ /local/components/ {
location ~ /\.default/.+ {
access_log off;
log_not_found off;
location ~ \.php$ {
try_files /f5debce384416c95c84c8122354ed680.htm @php;
}
location ~* ^.+\.(jpe?g|png|tiff|gif|webp|xml|html|yml|ogg|ogv|svg|svgz|eot|otf|woff|woff2|mp4|ttf|rss|atom|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|rtf|pdf|txt|js|css|bmp|pnm|pbm|ppm)$ {
access_log off;
expires 97d;
}
}
location ~ /\. { internal; }
location ~* [^/]\.(jpe?g|png|tiff|gif|webp|xml|yml|ogg|ogv|svgz?|eot|otf|woff2?|mp4|ttf|rss|atom|ico|zip|t?gz|rar|bz2|doc|xls|exe|ppt|tar|midi?|wav|rtf|pdf|txt|js|css|bmp|pnm|pbm|ppm)$ {
access_log off;
expires 97d;
}
location ~ \.php$ {
try_files /f5debce384416c95c84c8122354ed680.htm @php;
}
}
location ^~ /local { internal; }
location ^~ /upload/ {
location ~ /\. { internal; }
location ~* [^/]\.(jpe?g|png|tiff|gif|webp|xml|yml|ogg|ogv|svgz?|eot|otf|woff2?|mp4|ttf|rss|atom|ico|zip|t?gz|rar|bz2|doc|xls|exe|ppt|tar|midi?|wav|rtf|pdf|txt|js|css|bmp|pnm|pbm|ppm)$ {
access_log off;
expires 97d;
}
location ~ [^/]\.php$ { internal; }
}
location @php {
try_files $uri /bitrix/urlrewrite.php$is_args$args;
include /etc/nginx/fastcgi_params;
{FASTCGIPASS}
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
}
# Дополнительные правила для /docs/ и /company/
location ^~ /docs/shared/file/ { try_files $uri /bitrix/urlrewrite.php$is_args$args; }
location ^~ /company/personal/user/ { try_files $uri /bitrix/urlrewrite.php$is_args$args; }
nginx-------------------------------------------------------------------------------------------------------------------------------------------------------------