Hey there,
I began switching to nginx just recently and use an application I developed with Phalcon to test how the migration works. I now ran into a problem with redirects from phalcon which result in an 502 error from ngix which logs the following in my errorlog:
upstream sent invalid status "Redirect" while reading response header from upstream
This happens always when I'm redirecting in my code, i.e. for instance calling /admin would redirect you to /session/login if you're not logged in:
$this->response->redirect("session/login");
Other actions which don't redirect you work just fine. Querying google as to what might be the problem didn't really help, but I might have searched for the wrong things as nginx is still new to me.
Can anyone point me to the right direction please? :)
P.S.: Since someone might ask, this is my nginx config for the host in use:
server {
listen 80;
server_name domain.dev;
index index.php index.html index.htm;
set $root_path '/var/www/project/public';
root $root_path;
location / {
try_files $uri $uri/ /index.php?_url=$uri&$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}
location ~ /\.ht {
deny all;
}
}