I'm trying to migrate a service from a server to another.
It's a simple php
app.
On the first server (Apache
) I could request a JSON
in the following way:
my.vhost.myDomain.tld/apps?query=toto¶ms=aparam
On the second (nginx
), I should be able to do it the same way:
my.vhost.myOtherDomain.tld/apps?query=toto¶ms=aparam
Both applications include an index.php
that is served correctly by both web servers.
However, the /apps?
produce a 404 on nginx
.
My guess is that Apache
is doing some magic finding a php
file to process the query.
However, I'm quite a noob with this tools and I don't understand what is exactly happening on the Apache
server and how to configure nginx
to reproduce the same behavior ...
Is index.php
file processed as input?
So far I tried to specify my.vhost.myOtherDomain.tld/index.php/apps?query=toto¶ms=aparam
with little success.
And to explore Apache
configuration files without much help.
You are probably using mod_rewrite in Apache, which changes how URLs are handled by the server.
You can try:
Check http://nginx.org/en/docs/http/converting_rewrite_rules.html
To whoever might find this post through google:
Look at the hidden .htaccess, and rewrite its rules in nginx configuration.
Some websites can translate .htaccess style to nginx style configuration !