Hi,
Please, could anyone help me with this?
I’m developing a small webapp for bookings: it’s in one single domain: mydomain.dev
Inside that domain, there are several php files (that’s for legacy of old files) and, in a folder (call it “reservation”) it’s “installed” slim 2.6. Anyway, I have multiple instances of slim there, each one with its own routes:
The path are similar like this three:
/path/www.mysite.com/
public_html/ <-- Document root!
results.php <-- I instantiate Slim here!
booking.php <-- I instantiate Slim here!
vendor/
Slim/ <-- I store Slim lib files here!
- results.php, which has: $app->get(’/’, … })->via(‘GET’); and $app->post(’/get_items_list’, … });
- booking.php, which has: $app->get(’/’, … })->via(‘GET’; then $app->post(’/process’,… }); and $app->post(’/payment’,… }); and other several routes.
When I go to:
- mydomain.dev by GET => OK
- mydomain.dev/reservations/results.php by GET => OK
- mydomain.dev/reservations/results.php/get_items_list by POST => 404 (Not Found)
I’m using nginx as web server, but with multiple instances of slim, so I think the default configuration in slim page doesnt work: http://docs.slimframework.com/routing/rewrite/#nginx
How should be my nginx conf ?
The current one I have is:
server {
server_name mydomain.dev;
listen 80;
root /usr/share/nginx/html/mysite;
index index.php;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
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;
}
Could anyone help me please. All slim instances should work under the same domain.
Thank u very much