restful的nginx配置方法


 location /{
                                root /webserver/www/a.tk.com;
                                index index.html index.htm index.php;

                               
                                 if ( $document_uri ~ "/api/v1/(.*?)/(.*)/(.*)")
                                {
                                    rewrite ^/api/v1/(.*)/(.*)/(.*)$  /index.php?moudle=interface&control=$1&method=$2&id=$3 last;
                                }


                                if ( $document_uri ~ "/api/v1/(.*)/(.*)")
                                {
                                    rewrite ^/api/v1/(.*)/(.*)$  /index.php?moudle=interface&control=$1&method=$2 last;
                                }

                               


                        }

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM