Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
Обучение для смены профессии, роста в карьере и саморазвития
server {
server_name localhost;
location /admin {
proxy_pass http://127.0.0.1:8081;
}
}
server {
charset utf-8;
client_max_body_size 128M;
listen 8081; ## listen for ipv4
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6
server_name admin.local;
root /var/www/admin/web;
index index.php;
access_log /var/log/nginx/admin.access.log;
error_log /var/log/nginx/admin.error.log;
location / {
# Redirect everything that isn't a real file to index.php
try_files $uri $uri/ /index.php?$args;
}
# uncomment to avoid processing of calls to non-existing static files by Yii
#location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
# try_files $uri =404;
#}
#error_page 404 /404.html;
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php5-fpm.sock;
try_files $uri =404;
}
location ~ /\.(ht|svn|git) {
deny all;
}
}
Теперь по запросу в браузере xx.xx.xx.xx/admin выдает 404 ошибку, причем "составную" из 2-х частей. Первая часть отдалась Yii, а ниже нее стандартное сообщение 404 nginx. Пруф: habrastorage.org/files/d83/b65/6db/d83b656db0634c9...