M
M
Michael2019-01-19 17:09:53
Nginx
Michael, 2019-01-19 17:09:53

Incomprehensible line in the nginx config?

Hello reader!
A question about the nginx config - the source of the settings was some kind of article on the internet, in principle everything works, but one line try_files / d58f8ccd9bffa83ebec930554209111f.htm @php; confuses me so far, there were 2 questions:
1) What is it for? There is no such construction in the official doc.
2) How to write this config block correctly if item 1 is a priori taken from the ceiling?

location ~* \.(js|css|png|jpg|jpeg|gif|svg)$ {
            expires max;
            log_not_found off;
  etag on;
        }

        location ~ \.(php|html)$ {
            try_files /d58f8ccd9bffa83ebec930554209111f.htm @php;
        }

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Boris Syomov, 2019-01-19
@happy-cat

Looks for the file d58f8ccd9bffa83ebec930554209111f.htm and gives it as is, and if it doesn't find it, it transfers control to the named @php location.
This can be used so that when a file is added, it will be given to all requests corresponding to the location, and if it is removed, then the requests will go as usual. Type of maintenance mode, for example, you can organize something like that.

M
MegaLoadOn, 2019-01-19
@MegaLoadOn

Looks for file d58f8ccd9bffa83ebec930554209111f.htm and sends to named location @php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question