Установка с модулем
yum install unit unit-phpНастраиваем nginx
[root@nginx-unit ~]# cat /etc/nginx/conf.d/default.confupstream unit_bitrix_urlrewrite {
server 127.0.0.1:8090;
}
upstream unit_bitrix_direct {
server 127.0.0.1:8091;
}
server {
listen 80;
root /var/www/html/;
index index.php;
proxy_read_timeout 90s;
client_max_body_size 64m;
location / {
try_files $uri @urlrewrite_php;
}
location @urlrewrite_php {
proxy_pass http://unit_bitrix_urlrewrite;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location ~* \.php$ {
try_files $uri =404;
proxy_pass http://unit_bitrix_direct;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Настраиваем unit
[root@nginx-unit ~]# cat bitrix.json{
"listeners": {
"127.0.0.1:8090": {
"application": "bitrix_urlrewrite"
},
"127.0.0.1:8091": {
"application": "bitrix_direct"
}
},
"applications": {
"bitrix_urlrewrite": {
"type": "php",
"processes": {
"max": 20,
"spare": 5
},
"user": "apache",
"group": "apache",
"root": "/var/www/html/",
"script": "bitrix/urlrewrite.php"
},
"bitrix_direct": {
"type": "php",
"processes": {
"max": 20,
"spare": 5
},
"user": "apache",
"group": "apache",
"root": "/var/www/html/",
"index": "index.php"
}
}
}
Заливаем конфиг
curl -X PUT -d @bitrix.json --unix-socket /run/unit/control.sock http://localhost/configПолезные ссылки
https://unit.nginx.org/howto/wordpress/https://habr.com/ru/company/itsumma/blog/337346/
https://sysadmin.pm/nginx-unit/
Скрипт проверки соответствия Bitrix
Комментариев нет:
Отправить комментарий