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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -