Good day.
Yii works under apache with minimal configuration needed, provided in installation documentations. Yii is in the subdirectory of /var/www/yii. Seems that php, php-fpm and nginx work, as other parts of site are working and phpinfo returns information.
Nginx conf:
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
Virtual server conf:
server {
listen 8080;
server_name daisy.fuentes;
client_max_body_size 50m;
set $yii_bootstrap "index.php";
root /var/www/yii;
location / {
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_NAME '';
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_pass unix:/var/www/daisy.fuentes/fuentes.socket;
}
location /static {
root /var/www/daisy.fuentes/root;
expires 30d;
}
location ~ /\.ht {
deny all;
}
location ~ /yii/(protected|framework|nbproject) {
deny all;
access_log off;
log_not_found off;
}
location ~ /yii/themes/\w+/views {
deny all;
access_log off;
log_not_found off;
}
location /yii/ {
index $yii_bootstrap;
try_files $uri /$uri/ /yii/$yii_bootstrap?$args;
}
location ~ /yii/.*\.php$ {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass 127.0.0.1:19000;
include fastcgi_params;
set $fsn /$yii_bootstrap;
fastcgi_param SCRIPT_FILENAME $document_root$fsn;
#PATH_INFO and PATH_TRANSLATED can be omitted, but RFC 3875 specifies them for CGI
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fsn;
}
}
Perl catalyst is working OK, yii is not so lucky, I’m getting a lot of 404’s, no styles and seems, that no javascript
Typical example being
[21/Jun/2013:10:54:42 +0000] "GET /yii/css/common.css HTTP/1.1" 404 1572 "XXX/yii/index.php/site/login" "Mozilla/5.0 (X11; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0"
Although the files are there, in this case the /yii/css/common.css, but my guess is, nginx rewrite somehow mangles the uri.
Any insights on how to get yii up and running in this configuration?
Greetings.