B
B
brezhitskiy422020-07-15 13:42:42
Nginx
brezhitskiy42, 2020-07-15 13:42:42

What regex to use for subdomain in server_name Nginx?

Hello. Suggest a regular expression for the server_name directive that would process subdomains of the form tmp-01-некий_уникальный_идентификатор.mydomain.ru. That is tmp-01-, they are .mydomain.rualways present, and некий_уникальный_идентификаторcan be of any length and consist only of numbers and Latin characters.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2020-07-15
@brezhitskiy42

~^tmp\-01\-.+\.mydomain\.ru$~
nginx.org/ru/docs/http/server_names.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question