php-crud-api icon indicating copy to clipboard operation
php-crud-api copied to clipboard

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

Open Pangamma opened this issue 1 year ago • 1 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

Pangamma avatar Nov 05 '23 19:11 Pangamma

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

mevdschee avatar Nov 08 '23 07:11 mevdschee

Closing due to inactivity.

mevdschee avatar Mar 19 '24 09:03 mevdschee