Hi!
The rules for rewrite can be found at:
http://nginx.org/en/docs/http/ngx_http_rewrite_module.html[
^]
Looking at your "result" section, it says:
If the file specified exists (in the root of your document directory) and the URL matched the regular expression "^/(.*)$" then rewrite the URL to point to "/download.php?file=$1" and return a "temporary redirect" (302) HTTP code to the client (browser) to ask it to look in the new redirected location.
Without access to the rest of your config or any information about what platform you're running on, it is a bit tricky to tell where to go from here. I am also going to have to make some assumptions:
I'm going to assume:
- That the behavior described above is what you want
- That you have access to your nginx config file (usually located somewhere like
/etc/nginx/nginx.conf)
- That ngx_http_rewrite_module is active
What I'd recommend as a start is that you:
* Check that the root directory is set correctly for your site.
It is specified in the
nginx.conf file (or your site's config file) and according to what you said above should look something like:
root /home/admin/domains/mydomain.com/public_html/;
* Check that the file you are trying to access exists in the directory specified as root
* Check the permissions on the file / directory
If these are all correct, let me know and we can take the next steps to solving your problem.
Regards,
Loki