mevdschee / php-crud-api

Single file PHP script that adds a REST API to a SQL database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to set up nginx if you wanted the api to be hosted at the "/foo" path?

Pangamma opened this issue · comments

Due to plesk and having other items hosted on my site, I am unable to set up the API to be used at the root location as shown in the example. https://github.com/mevdschee/php-crud-api#nginx-config-example Can someone please post a modified nginx configuration that would enable this php-crud-api to work properly when hosted at foo?

Example
GET https://example.com/foo/records/users/1

Hi Taylor, Thank you for your question. The example (in the readme) is for:

GET https://example.com/api.php/records/users/1

You may rename the script to foo.php and have:

GET https://example.com/foo.php/records/users/1

After you have that working, you may look at #534 to hide the php extension.

I hope this helps! Kind regards, Maurits

Closing due to inactivity.