V
V
Vladimir2020-11-18 15:56:10
PHP
Vladimir, 2020-11-18 15:56:10

How to setup nginx for REST API?

Trying to follow this tutorial https://youtu.be/COb-KpOfCSw?t=1810
It uses apache server and I want to use nginx.
5fb519b032242641214414.png

I need all requests sent to mydomain.com/api/ to be handled through the api.php script
AND somehow placed in the $_GET['q'] variable so that it is available in my api.php script
5fb519b9a8567440766896.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fedor Vlasenko, 2020-11-18
@Cosss

location / {
try_files $uri $uri/ /api.php?$args;
}

All requests to api.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question