瀏覽代碼

add php ngx conf

abiao 5 年之前
父節點
當前提交
391d82c57c
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      webApp/common/nginx_conf/ngx_test.conf

+ 4 - 0
webApp/common/nginx_conf/ngx_test.conf

@@ -38,6 +38,10 @@ server {
         alias /home/www/yii2_app/webApp/frontend/web/uploads/;
     }
 
+    location ~ /api/(?!index.php).*$ {
+        rewrite /api/(.*) /api/index.php?r=$1 last;
+    }
+
     location ~ \.php$ {
         fastcgi_pass   127.0.0.1:9000;
         fastcgi_index  index.php;