Php nginx config仅允许访问特定文件

Php nginx config仅允许访问特定文件,php,nginx,Php,Nginx,我对nginx非常陌生(只是从Apache和.htaccess文件迁移),我的设置非常具体。我想: 允许访问index.html、/build、/images、/api/public/index.php 只有 将所有请求转移到index.html,除非该文件存在于 /图像或/构建 除了进入/api文件夹的任何请求,其中 必须全部导入/api/public/index.php php是我的API前端控制器,虽然这将打开一百万个其他php文件,但我的理解是HTTP请求者不需要访问这些文件 那么,从哪

我对nginx非常陌生(只是从Apache和.htaccess文件迁移),我的设置非常具体。我想:

  • 允许访问index.html、/build、/images、/api/public/index.php 只有
  • 将所有请求转移到index.html,除非该文件存在于 /图像或/构建
  • 除了进入/api文件夹的任何请求,其中 必须全部导入/api/public/index.php
  • php是我的API前端控制器,虽然这将打开一百万个其他php文件,但我的理解是HTTP请求者不需要访问这些文件

    那么,从哪里开始呢