default.conf 1.5 KB

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