A
A
Alexander Pankov2016-10-04 14:55:03
Nginx
Alexander Pankov, 2016-10-04 14:55:03

How to write nginx config?

Hello, I am implementing an API on a website.
the API method call will be something like this:
/api/user.getFoo?arg=1234
The fact is that I want to send a request to the api/index.php page at a similar URL: api/api_method?arg=data where I will already parse the requested URL and call - return the necessary data ..
did it on htaccess quickly:

RewriteRule ^api/((?!index\.php$).+)$ /api/index.php [L,NC]

but it doesn't seem to go to nginx, I've already tried everything .. it tries to find the section in the api folder and spits out 404
Thanks in advance for the help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin, 2016-10-26
@TheSpbra1n

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

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question