nginx disallow direct file access, allow domain only -
i need advise how implement following rules nginx:
if user requests domain.com (or domain) directly, send him node.js application (proxy_pass http://localhost:8080;), if user requests file or other url directly, not clear top domain name, serve /img.png file.
any ideas how implement that?
here go:
if ($request_uri != "/") { rewrite ^ /img.png last; } location /img.png { internal; root /path/to/image; }
Comments
Post a Comment