Block access to every file in the site but index.htm

Edho P Arief edhoprima at
Fri Feb 18 05:59:11 MSK 2011

On Fri, Feb 18, 2011 at 9:00 AM, atipico <nginx-forum at> wrote:
> I have a site with just one file: index.htm witch have some ajax linked
> to php files. I'd like to make thouse php files only accessable via ajax
> (post and get) coming from this index file and block access to all files
> but the index.htm. Is it possible in Nginx? Thanks.

location = /index.htm {
  root ...

location / { return 404; }

More information about the nginx mailing list