H
H
HoHsi2015-10-13 21:39:29
Nginx
HoHsi, 2015-10-13 21:39:29

How to proxy NGINX if file not found?

Good evening!
How to proxy an NGINX request if the file doesn't exist?

location /public {
    root /apps/nodejs/server.ru/production;

     # как сделать proxy_pass http://127.0.0.1:1337/generate-img/; , если файла нет?
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dan Ivanov, 2015-10-13
@ptchol

nginx.org/ru/docs/http/ngx_http_core_module.html#t...
An example, customize it for yourself.

location / {
    try_files /system/maintenance.html
              $uri $uri/index.html $uri.html
              @mongrel;
}

location @mongrel {
    proxy_pass http://mongrel;
}

V
Vlad Zhivotnev, 2015-10-14
@inkvizitor68sl

error_page 404 [email protected]; inside loki with static.
Well, in location @backend { } you already describe how to get into the backend.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question