Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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&params=aparam

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

my.vhost.myOtherDomain.tld/apps?query=toto&params=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&params=aparam with little success.
And to explore Apache configuration files without much help.

share|improve this question

2 Answers 2

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;

Check http://nginx.org/en/docs/http/converting_rewrite_rules.html

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

 
discard

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.