default.conf 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. server {
  2. listen 80 default_server;
  3. server_name _;
  4. return 404;
  5. }
  6. server {
  7. charset utf-8;
  8. client_max_body_size 128M;
  9. sendfile off;
  10. listen 80;
  11. server_name localhost;
  12. root /app/sapi/web/;
  13. index index.php;
  14. access_log /app/sapi/runtime/logs/access-$server_name.log;
  15. error_log /app/sapi/runtime/logs/error.log;
  16. location / {
  17. if ($args ~ x-oss-process=(style\/\d+[w|h])){
  18. proxy_pass http://127.0.0.1/v1/common/thumbnail?file=$document_uri&x-oss-process=$1;
  19. }
  20. try_files $uri $uri/ /index.php$is_args$args;
  21. }
  22. location ~ \.php$ {
  23. include fastcgi_params;
  24. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  25. fastcgi_pass unix:/tmp/php-cgi.sock;
  26. try_files $uri =404;
  27. }
  28. location ~ /\.(ht|svn|git) {
  29. deny all;
  30. }
  31. }
  32. server {
  33. charset utf-8;
  34. client_max_body_size 128M;
  35. sendfile off;
  36. listen 80; ## listen for ipv4
  37. server_name 127.0.0.1;
  38. root /app/sapi/web/;
  39. index index.php;
  40. location / {
  41. try_files $uri $uri/ /index.php$is_args$args;
  42. }
  43. location ~ \.php$ {
  44. include fastcgi_params;
  45. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  46. fastcgi_pass unix:/tmp/php-cgi.sock;
  47. try_files $uri =404;
  48. }
  49. location ~ /\.(ht|svn|git) {
  50. deny all;
  51. }
  52. }