nginx.conf 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. worker_processes 1;
  2. events {
  3. worker_connections 1024;
  4. }
  5. error_log nginx_main_error.log info;
  6. pid nginx_user.pid;
  7. daemon off;
  8. http {
  9. access_log nginx_access.log;
  10. error_log nginx_error.log info;
  11. include /etc/nginx/mime.types;
  12. default_type application/octet-stream;
  13. sendfile on;
  14. server {
  15. # listen 8080 ssl;
  16. listen 8081;
  17. server_name localhost;
  18. gzip on;
  19. # Enable compression for .wasm, .js and .txt files (used for the runtime chunks)
  20. gzip_types application/javascript application/wasm text/plain application/octet-stream;
  21. charset utf-8;
  22. # ssl_certificate nginx.crt;
  23. # ssl_certificate_key nginx.key;
  24. location / {
  25. root .;
  26. autoindex on;
  27. index index.html index.htm;
  28. add_header 'Access-Control-Allow-Origin' '*' always;
  29. add_header 'Access-Control-Expose-Headers' 'content-length' always;
  30. add_header 'Cross-Origin-Opener-Policy' 'same-origin' always;
  31. add_header 'Cross-Origin-Embedder-Policy' 'require-corp' always;
  32. add_header 'Cross-Origin-Resource-Policy' 'cross-origin' always;
  33. #auth_basic "CX Demo";
  34. #auth_basic_user_file basicauth;
  35. }
  36. location /images/ {
  37. root .;
  38. if ($arg_s != "") {
  39. rewrite ^/images/(.*)$ $1 break;
  40. }
  41. if ($arg_s = "") {
  42. gzip off;
  43. }
  44. error_page 404 =200 /images_slicer/$uri?$args;
  45. }
  46. location /images_slicer/ {
  47. proxy_pass http://localhost:8082/images/;
  48. proxy_http_version 1.0;
  49. proxy_set_header Range bytes=$arg_s-$arg_e;
  50. proxy_hide_header Content-Range;
  51. }
  52. }
  53. server {
  54. listen 127.0.0.1:8082;
  55. server_name localhost;
  56. charset utf-8;
  57. location / {
  58. root .;
  59. }
  60. }
  61. }