Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:


On the second (nginx), I should be able to do it the same way:


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&params=aparam with little success.
And to explore Apache configuration files without much help.

share|improve this question

You are probably using mod_rewrite in Apache, which changes how URLs are handled by the server.

You can try:

rewrite  ^apps$ apps.php last;


share|improve this answer
Ho god, the url rewriting... I totally forgot about this one ! – Antzi Jul 21 '14 at 6:33
up vote 0 down vote accepted

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 !

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.