Welcome! Log In Create A New Profile

Advanced

need to preserve / in location

Gregory Edigarov
April 22, 2020 04:48AM
Hello, Everybody

this is directory structure:

/front/admin/index.html

/front/superadmin/index.html

that's what I have in config

    rewrite ^/(admin)$ /$1/ last;
    location /admin/ {
        index index.html;
        root /front;
        try_files $uri  admin/index.html;                 #direct all
request to index.html
   }

and the errors:

2020/04/22 08:35:13 [error] 73#73: *1 open() "/frontindex.html" failed
(2: No such file or directory), client: 192.168.224.1, server: ,
request: "GET /admin HTTP/1.1", host: "127.0.0.1"
192.168.224.1 - - [22/Apr/2020:08:35:13 +0000] "GET /admin HTTP/1.1" 404
146 "-" "curl/7.58.0" "-"

2020/04/22 08:35:24 [error] 73#73: *2 open() "/frontindex.html" failed
(2: No such file or directory), client: 192.168.224.1, server: ,
request: "GET /admin/ HTTP/1.1", host: "127.0.0.1"
192.168.224.1 - - [22/Apr/2020:08:35:24 +0000] "GET /admin/ HTTP/1.1"
404 146 "-" "curl/7.58.0" "-"

what's the right config in situation given?

--

With best regards,

        Gregory Edigarov

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

need to preserve / in location

Gregory Edigarov April 22, 2020 04:48AM

Re: need to preserve / in location

Gregory Edigarov April 22, 2020 05:20AM

Re: need to preserve / in location

Maxim Dounin April 22, 2020 11:18AM

Re: need to preserve / in location

Gregory Edigarov April 24, 2020 09:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 235
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready