F
F
FilimoniC2011-11-24 00:24:43
Nginx
FilimoniC, 2011-11-24 00:24:43

Nginx location regex?

I ask for all possible help with regex in
nginx
There is a site, the site has sections test and testabcd.
It is necessary that links of the form

http: //site/test<br/>
http: //site/test/<br/>
http: //site/test/something/file.html<br/>
http: //site/test/something/id<br/>
http: //site/testabcd<br/>
http: //site/testabcd/<br/>
http: //site/testabcd/something/id<br/>
http: //site/testabcd/something/file.html <br/>
попадали под location с fastcgi.<br/>
Но при этом<br/>
http: //site/testqwerty/<br/>
http: //site/test%SMTH% , где %SMTH% - что угодно, непредсказуемое

did not fall into this Location
Tell me how to implement it correctly?
Now something like
location ~* /(test|testabcd)/ {<br/>
 fastcgi_pass unix:/tmp/php-fpm.socket;<br/>
 ......<br/>
}

At http://site/test
it downloads test (which is a php script actually)

Answer the question

In order to leave comments, you need to log in

5 answer(s)
E
Evengard, 2011-11-24
@FilimoniC

Well, why did you stick a slash at the end? That's why it downloads.
Create a second location - without a trace - and rewrite or redirect to the one with the slash.

S
sdevalex, 2011-11-24
@sdevalex

Do you mean this? Static is heard, and at a certain backend address ...

    server
    {
        listen       80;
        server_name  localhost;

        charset utf-8;
        
        location /q { //обработка backend...
            proxy_pass http://localhost:8000;
            proxy_set_header Host $host;
        }

        location / {
            root   /home/alex/projects/web/localhost/public;
            index  index.html;
        }
    }

T
Tornado239, 2013-08-08
@Tornado239

There can be only one primary name server with all records about the zone, but there can be several secondary ones. You don’t need to write anything with the handles, the secondary servers themselves will load the zone from the primary and will update it when changes are made on the primary (on the primary, you only need to register the IP addresses of the secondary ones so that they can load the zone). The same NIC.ru has a service of providing secondary DNS servers in different geographical areas, almost all registrars have this service if you need additional insurance against the global fall of NIC.ru (which is quite unlikely). You will only need to register secondary servers at the domain registrar for your zone (add NS records to the existing one).
As for the second question, first decide for yourself where you want to receive mail - at home or on yandex.

M
Maxim Timokhin, 2013-08-08
@timokhin

On the second question: there will be no problems, you can register your mx there

M
MiXei4, 2013-08-08
@MiXei4

You need to create an MX record if you want to post mail on Yandex. In your case, if you use your server for mail, then of course you don’t need to add any other records.
Moreover, on the Yandex DNS (if your scheme suddenly works), you need to change the MX records to yours.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question