Answer the question
In order to leave comments, you need to log in
502 Bad Gateway nginx/1.17.5 Yii2, what's the problem?
server {
listen 80;
server_name localhost;
set $base_root "мой рут";
# set $base_root /;
# set $base_root /usr/share/nginx/academy.smartworld.team/;
root $base_root;
charset UTF-8;
index index.php index.html;
location / {
root $base_root/frontend/web;
try_files $uri $uri/ /frontend/web/index.php$is_args$args;
location ~ ^/assets/.+\.php(/|$) {
deny all;
}
}
location /admin {
alias $base_root/backend/web/;
try_files $uri /backend/web/index.php$is_args$args;
location ~ ^/admin/assets/.+\.php(/|$) {
deny all;
}
}
location ~ ^/.+\.php(/|$) {
rewrite (?!^/((frontend|backend)/web|admin))^ /frontend/web$uri break;
rewrite (?!^/backend/web)^/admin(/.+)$ /backend/web$1 break;
include fastcgi_params;
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
}
location ~ /\. {
deny all;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question