ngx_test.conf 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. server {
  2. listen 80;
  3. client_max_body_size 4G;
  4. server_name yii2_admin.hiwavo.com;
  5. #keepalive_timeout 5;
  6. access_log /home/www/yii2_app/webApp/common/nginx_conf/log/ngx_access.log main;
  7. error_log /home/www/yii2_app/webApp/common/nginx_conf/log/ngx_error.log;
  8. root /home/www/yii2_app/webApp/backend/web;
  9. index index.php index.html index.htm;
  10. try_files $uri $uri/ /index.php?$args;
  11. location ~ /api/(?!index.php).*$ {
  12. rewrite /api/(.*) /api/index.php?r=$1 last;
  13. }
  14. location ~ \.php$ {
  15. fastcgi_pass 127.0.0.1:9000;
  16. fastcgi_index index.php;
  17. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  18. include fastcgi_params;
  19. try_files $uri =404;
  20. }
  21. }
  22. server {
  23. listen 80;
  24. client_max_body_size 4G;
  25. server_name yii2_front.hiwavo.com;
  26. #keepalive_timeout 5;
  27. access_log /home/www/yii2_app/webApp/common/nginx_conf/log/ngx_access.log main;
  28. error_log /home/www/yii2_app/webApp/common/nginx_conf/log/ngx_error.log;
  29. root /home/www/yii2_app/webApp/frontend/web/;
  30. index index.php index.html index.htm;
  31. try_files $uri $uri/ /index.php?$args;
  32. location /uploads {
  33. alias /home/www/yii2_app/webApp/frontend/web/uploads/;
  34. }
  35. location ~ /api/(?!index.php).*$ {
  36. rewrite /api/(.*) /api/index.php?r=$1 last;
  37. }
  38. location ~ \.php$ {
  39. fastcgi_pass 127.0.0.1:9000;
  40. fastcgi_index index.php;
  41. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  42. include fastcgi_params;
  43. try_files $uri =404;
  44. }
  45. }