Нужно запустить отдельно PHP скрипт от фреймворка
Самое интересное, что в frontend - запускается нормально
не запускается в backend
Можно что-то сделать?
Спасибо за внимание
Код: Выделить всё
upstream php-fpm
{
server unix:/var/run/php/php7.0-fpm.sock;
}
server {
listen 80;
server_name ~^(?<subdomain>cp|api|agent|medrep)\.pharmznanie\.ru;
index index.php index.html index.htm;
root /var/www/pharmznanie;
rewrite ^/(.*)/$ /$1 permanent;
charset utf-8;
location / {
root /var/www/pharmznanie/$subdomain/web;
try_files $uri /$subdomain/web/index.php?$args;
}
location ~ \.php$ {
try_files $uri /$subdomain/web$uri =404;
fastcgi_pass php-fpm;
include /etc/nginx/fastcgi_params;
fastcgi_split_path_info ^(.+?\.php)(/.*)?$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_index index.php;
}
}
server {
listen 80;
server_name pharmznanie.ru www.pharmznanie.ru phznanie.ru www.phznanie.ru pharm-znanie.ru www.pharm-znanie.ru;
return 301 https://pharmznanie.ru$request_uri;
}
server {
listen 443 ssl;
server_name pharmznanie.ru;
# ssl_certificate /etc/nginx/ssl/pharmznanie_nic.crt;
# ssl_certificate /etc/nginx/ssl/pharmznanie_ru_2017_11_02-bundle.crt;
# ssl_certificate_key /etc/nginx/ssl/pharmznanie_nic.key;
# ssl_certificate /etc/nginx/ssl/old/pharmznanie.ru.strong-DH.crt;
# ssl_certificate_key /etc/nginx/ssl/old/pharmznanie.ru.key;
ssl_certificate /etc/nginx/ssl/reg_ru.crt;
ssl_certificate_key /etc/nginx/ssl/reg_ru.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
index index.php index.html index.htm;
root /var/www/pharmznanie;
rewrite ^/(.*)/$ /$1 permanent;
charset utf-8;
location / {
root /var/www/pharmznanie/frontend/web;
try_files $uri /frontend/web/index.php?$args;
}
location ~ \.php$ {
try_files $uri /frontend/web$uri =404;
fastcgi_pass php-fpm;
include /etc/nginx/fastcgi_params;
fastcgi_split_path_info ^(.+?\.php)(/.*)?$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_index index.php;
}
location /admin {
alias /var/www/pharmznanie/backend/web;
try_files $uri /backend/web/index.php?$args;
location ~ ^/admin/(.+\.php)$ {
try_files $uri /backend/web/$1?$args;
}
}
location /storage {
alias /var/www/pharmznanie/storage;
}
}
# default
server {
listen 80 default_server;
index index.html index.htm index.nginx-debian.html;
server_name _;
return 403;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
}