漂亮的api网址末尾的位置重定向

时间:2019-08-01 14:27:29

标签: nginx-config

    Below are two blocks in the /etc/nginx/sites-enabled/default one after the other as seen below :-
    # First section
    1. location / {
           try_files $uri $uri/ /index.php?$query_string;
    }
    #Second location block -

    2. location /pilot/(.*)/?$ {
           #try_files $uri $uri/ /pilot?id=$1;
           try_files $uri $uri/ /index.php?id=$1;
        }

    Even then when I hit http://localhost:8080/pilot/66 it just shows me the result as same as http://localhost:8080/pilot or http://localhost:8080/pilot/. It should have showed me result on for 66 (id=66) only. Thanks in advance!

已引用http://blog.martinfjordvald.com/2011/02/nginx-primer-2-from-apache-to-nginx/。来自https://www.nginx.com/resources/wiki/start/index.html

0 个答案:

没有答案