default.conf 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 = /v2/report-forms/inventory-notice-list {
  17. log_not_found off;
  18. access_log off;
  19. try_files $uri $uri/ /index.php$is_args$args;
  20. }
  21. location = /v2/printer/printer-list {
  22. log_not_found off;
  23. access_log off;
  24. try_files $uri $uri/ /index.php$is_args$args;
  25. }
  26. location / {
  27. if ($args ~ x-oss-process=(style\/\d+[w|h])){
  28. proxy_pass http://127.0.0.1/v1/common/thumbnail?file=$document_uri&x-oss-process=$1;
  29. }
  30. try_files $uri $uri/ /index.php$is_args$args;
  31. }
  32. location ~ \.php$ {
  33. include fastcgi_params;
  34. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  35. fastcgi_pass unix:/tmp/php-cgi.sock;
  36. try_files $uri =404;
  37. }
  38. location ~ /\.(ht|svn|git) {
  39. deny all;
  40. }
  41. }
  42. server {
  43. charset utf-8;
  44. client_max_body_size 128M;
  45. sendfile off;
  46. listen 443;
  47. server_name localhost;
  48. root /app/sapi/web/;
  49. index index.php;
  50. access_log /app/sapi/runtime/logs/access-$server_name.log;
  51. error_log /app/sapi/runtime/logs/error.log;
  52. ssl on;
  53. ssl_certificate_key /app/data/key;
  54. ssl_certificate /app/data/cert;
  55. location / {
  56. if ($args ~ x-oss-process=(style\/\d+[w|h])){
  57. proxy_pass http://127.0.0.1/v1/common/thumbnail?file=$document_uri&x-oss-process=$1;
  58. }
  59. try_files $uri $uri/ /index.php$is_args$args;
  60. }
  61. location ~ \.php$ {
  62. include fastcgi_params;
  63. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  64. fastcgi_pass unix:/tmp/php-cgi.sock;
  65. try_files $uri =404;
  66. }
  67. location ~ /\.(ht|svn|git) {
  68. deny all;
  69. }
  70. }
  71. server {
  72. charset utf-8;
  73. client_max_body_size 128M;
  74. sendfile off;
  75. listen 80; ## listen for ipv4
  76. server_name 127.0.0.1;
  77. root /app/sapi/web/;
  78. index index.php;
  79. location / {
  80. try_files $uri $uri/ /index.php$is_args$args;
  81. }
  82. location ~ \.php$ {
  83. include fastcgi_params;
  84. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  85. fastcgi_pass unix:/tmp/php-cgi.sock;
  86. try_files $uri =404;
  87. }
  88. location ~ /\.(ht|svn|git) {
  89. deny all;
  90. }
  91. }