I have a site with just one file: index.htm
which have some ajax linked to php files. I'd like to make those php files only accessible 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.
Two thoughts:
In the end, somebody's going to be able to get to them directly by forging headers, but it's a start.
Something like this would work:
Buf keep in mind that it is easy to spoof this header, for e.g.: