Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
hello. i’m trying to set this up on ubuntu 14.04 with php-fpm. the nginx conf file doesn’t seem to be working.
i have my kohana app in a user subdirectory of my vps. so i set root /path/to/myusername/Sites/public
here is my conf file (sorry its a mess because i’ve been putting things in and taking them out to see what if anything will work)
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /home/gabreal/Sites/public;
index index.html index.htm index.php;
# Make site accessible from http://localhost/
server_name localhost;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ @kohana =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
#if (!-e $request_filename)
#{
# rewrite ^/(.*)$ /index.php/$1 last;
#}
}
# Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
#location /RequestDenied {
# proxy_pass http://127.0.0.1:8080;
#}
error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
try_files $uri $uri/ @kohana;
#if ($request_uri ~* /grader/.*$) {
# root /home/gabreal/Sites/public/grader/grader;
#}
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
#
# # With php5-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location @kohana {
rewrite ^/(.+)$ /index.php$request_uri last;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
when i go to http://example.com/horizons/grader/ the app is obviously picking this up because it checks the cookie to see if the user is logged in and redirects to http://example.com/horizons/grader/user/login/. HOWEVER then i get nginx 404 error. so it looks like for some reason the kohana app isn’t getting to handle the uri routing.
i have this working perfectly on two local machines running apache and mod_php, but i need to deploy this to the vps. any help would be greatly appreciated!
@gad2103: Try using the config from part 3 of the Kohana series. Does that work?
unfortunately no. now i’m getting 500 errors from nginx. i tried changing the root directory to a single kohana app and nothing is working. i also tried switching to apache2 and oddly i get exactly the same behavior. the default route works but any other controller/action gives a 404 or 403 error (nginx and apache respectively.)
i’ve been trying to get this working for days. meanwhile i have it running locally on several different machines without any problem. i don’t think i understand php-fpm and nginx enough to know why this is happening. but it looks like the server is not giving control over to kohana when it should?
do you have any ideas? i’m going crazy trying to get this up and running…
thanks