Hi everyone,
I've started learning Phalcon about half year ago, and I used Apache with no problem
Now I want to switch to Nginx, because I'm also working on a project with Magento, and I deploy Magento on Nginx without problem.
Today, I tried to build the simple rest api https://docs.phalcon.io/en/latest/reference/tutorial-rest.html
I've editted host file 127.0.0.1 api.test.com
The project folder is in /var/www/api.test.com/public_html/ (I mean index.php and folder models in is public_html)
This is my config in .../etc/nginx/site-availables/api.test.com
server {
listen 80;
server_name api.test.com;
root /var/www/api.test.com/public_html;
## rewrite example.com to www.example.com
if ($http_host != "api.test.com") {
rewrite ^ $scheme://api.test.com$request_uri permanent;
}
location / {
index index.html index.php; ## Allow a static html file to be shown fir$
try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's $
expires 30d; ## Assume all files are cachable
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root /var/www/api.test.com/public_html;
}
location ~ /\.ht {
deny all;
access_log off;
log_not_found off;
}
}
And I also link this to /etc/nginx/site-enables/api.test.com
When I go to api.test.com on the browser bar, I can only see the Nginx default index.html (I mean Welcome to Nginx...)
Anyone know why it doesn't point to the api.test.com/public_folder/index.php?
Thank you very much