Hi there,
I'm trying to settup a simple url-rewriting on a nginx/fpm-php config/phalcon. I'm planning to create a multi-module platform (public , api, admin) and I'd like my visitors requests to be redirected to /public/index.php in case no module is requested.
So I've added the following in my nginx config:
... location / { rewrite ^$ /public/ break;
rewrite ^/$ /public/ break;
rewrite !^/(public|api|admin)/$ /public/$1 break;
}
try_files $uri $uri/ /index.php?$uri&$args;
location ~ .php$ { try_files $uri =404; include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SERVER_NAME $host;
...
} ...
It works fine if i try to access https://my.domain.dev or https://my.domain.dev/ or https://test.nis.dev/public/index.php But then it get's weird. if I try to access https://my.domain.dev/public/, the php file is not executed, and is uploaded as a text file (downloaded by the browser)
If I try to access https://my.domain.dev/index.html, I get the phalcon (?) message : "Mod-Rewrite is not enabled Please enable rewrite module on your web server to continue"
So it seems something is wrong, I could help some help.