浏览代码

add php ngx conf

abiao 5 年之前
父节点
当前提交
5396ae6e19
共有 1 个文件被更改,包括 23 次插入0 次删除
  1. 23 0
      webApp/common/nginx_conf/ngx_test.conf

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

@@ -0,0 +1,23 @@
+server {
+    listen 80;
+    client_max_body_size 4G;
+    server_name yii2_admin.hiwavo.com;
+    #keepalive_timeout 5;
+    access_log  /home/www/yii2_app/webApp/common/log/ngx_access.log  main;
+    error_log   /home/www/yii2_app/webApp/common/log/ngx_error.log;
+    root   /home/www/yii2_app/webApp/common/backend/web;
+    index  index.php index.html index.htm;
+    try_files $uri $uri/ /index.php?$args;
+
+    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;
+        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
+        include        fastcgi_params;
+        try_files $uri =404;
+    }
+}