0

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.

2 Answers 2

1

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

1
  • Ho god, the url rewriting... I totally forgot about this one !
    – Antzi
    Jul 21, 2014 at 6:33
0

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 !

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .