default.conf 2.5 KB

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