default.conf 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 443;
  37. server_name localhost;
  38. root /app/sapi/web/;
  39. index index.php;
  40. access_log /app/sapi/runtime/logs/access-$server_name.log;
  41. error_log /app/sapi/runtime/logs/error.log;
  42. ssl on;
  43. ssl_certificate_key /app/data/key;
  44. ssl_certificate /app/data/cert;
  45. location / {
  46. if ($args ~ x-oss-process=(style\/\d+[w|h])){
  47. proxy_pass http://127.0.0.1/v1/common/thumbnail?file=$document_uri&x-oss-process=$1;
  48. }
  49. try_files $uri $uri/ /index.php$is_args$args;
  50. }
  51. location ~ \.php$ {
  52. include fastcgi_params;
  53. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  54. fastcgi_pass unix:/tmp/php-cgi.sock;
  55. try_files $uri =404;
  56. }
  57. location ~ /\.(ht|svn|git) {
  58. deny all;
  59. }
  60. }
  61. server {
  62. charset utf-8;
  63. client_max_body_size 128M;
  64. sendfile off;
  65. listen 80; ## listen for ipv4
  66. server_name 127.0.0.1;
  67. root /app/sapi/web/;
  68. index index.php;
  69. location / {
  70. try_files $uri $uri/ /index.php$is_args$args;
  71. }
  72. location ~ \.php$ {
  73. include fastcgi_params;
  74. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  75. fastcgi_pass unix:/tmp/php-cgi.sock;
  76. try_files $uri =404;
  77. }
  78. location ~ /\.(ht|svn|git) {
  79. deny all;
  80. }
  81. }