forked from Nickmob/nginx_conf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx-files-comp.conf
99 lines (78 loc) · 2.73 KB
/
nginx-files-comp.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
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
server {
listen 192.168.0.1:80;
server_name metodlab.ru;
return 301 https://www.metodlab.ru$request_uri;
}
server {
listen 192.168.0.1:443 ssl;
ssl_certificate /etc/nginx/ssl/metodlab.crt;
ssl_certificate_key /etc/nginx/ssl/metodlab.key;
ssl_trusted_certificate /etc/nginx/ssl/comodo-ocsp-bundle.crt;
server_name metodlab.ru;
charset utf-8;
root "/home/httpd/metodlab/www";
set $test_file "bitrix/html_pages/$host$uri/index@$args.html";
set $storedAuth "";
set $usecache "";
if ( $http_bx_action_type = "" ) { set $usecache "A"; }
if ( $request_method = "GET" ) { set $usecache "${usecache}B"; }
if ( $cookie_BITRIX_SM_NCC = "" ) { set $usecache "${usecache}C"; }
if ( $http_x_forwarded_scheme !~ "https" ){ set $usecache "${usecache}D"; }
modern_browser_value "modern";
modern_browser msie 10.0;
modern_browser unlisted;
if ($modern_browser) {
set $usecache "${usecache}E";
}
if ( $cookie_BITRIX_SM_LOGIN != "" ) { set $storedAuth "A"; }
if ( $cookie_BITRIX_SM_UIDH != "" ) { set $storedAuth "${storedAuth}B"; }
if ( $cookie_BITRIX_SM_CC != "Y" ) { set $storedAuth "${storedAuth}C"; }
if ( $storedAuth !~ "ABC" ) { set $usecache "${usecache}F"; }
location ~* @.*\.html$ {
internal;
# Debug only
access_log off;
}
set $php_sock "unix:/run/php/php7.2-fpm.sock";
index index.php;
location / {
try_files $test_file $uri $uri/ @bitrix;
limit_req zone=ltwo burst=6 nodelay;
}
location ~ \.php$ {
try_files $uri @bitrix;
client_max_body_size 200m;
include fastcgi_params;
#fastcgi_param HTTPS on;
fastcgi_pass $php_sock;
fastcgi_index index.php;
#fastcgi_intercept_errors on;
fastcgi_read_timeout 1200;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location @bitrix {
fastcgi_pass $php_sock;
include fastcgi_params;
fastcgi_read_timeout 1200;
fastcgi_param SCRIPT_FILENAME $document_root/bitrix/urlrewrite.php;
}
location ~* ^/upload/resize_cache {
try_files $uri @resize;
include /etc/nginx/static.conf;
}
location @resize {
#rewrite ^/upload\/resize_cache\/preview.*$ /preview.php break;
fastcgi_pass $php_sock;
include fastcgi_params;
fastcgi_read_timeout 30;
fastcgi_param SCRIPT_FILENAME $document_root/preview.php;
}
# Static files location
location ~* \.(jpg|jpeg|gif|png)$ {
include /etc/nginx/static-webp.conf;
}
# Static files location
location ~* \.(ttf|eot|svg|woff|woff2|css|js|json|ico|zip|tgz|gz|rar|bz2|doc|docx|xlsx|pptx|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|avi|swf|flv|mp3|mp4|fla)$ {
include /etc/nginx/static.conf;
}
}