Nginx Test data of php app

Youngsoo Lee 2016-11-14 21:09:41
Test result of rewirte url of nginx with settings in engine-pmc

properties

* config location / { rewrite ^/login(\/?)$ /index.php?module=login&action=dispLoginPage&$query_string; rewrite ^/([0-9]+).*$ /index.php?module=board&action=dispArticle&article_no=$1&$query_string; rewrite ^/([a-zA-Z0-9-_]+)/?$ /index.php?menu=$1&$query_string; rewrite ^/([a-zA-Z0-9-_]+)/([a-zA-Z0-9-_]+)/?$ /index.php?menu1=$1&menu2=$2$query_string; rewrite ^/([a-zA-Z0-9-_]+)/([a-zA-Z0-9-_]+)/([a-zA-Z0-9-_]+)/?$ /index.php?menu1=$1&menu2=$2&menu3=$3$query_string; }

input

1
2
3
4
5
6
/test
/login
/my/menu1
/hello
/board/123
/board/freeboard

output

Rewritten URL Parameter  
1
/index.php
menu=test&
 
2
/index.php
module=login&action=dispLoginPage&
 
3
/index.php
menu1=my&menu2=menu1
 
4
/index.php
menu=hello&
 
5
/index.php
menu1=board&menu2=123
 
6
/index.php
menu1=board&menu2=freeboard
 

comments