nginx.template 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. worker_processes auto;
  2. error_log /var/log/nginx/error.log;
  3. pid /run/nginx.pid;
  4. events {
  5. worker_connections 1024;
  6. }
  7. http {
  8. include mime.types;
  9. default_type application/octet-stream;
  10. server_names_hash_bucket_size 512;
  11. client_header_buffer_size 32k;
  12. large_client_header_buffers 4 32k;
  13. client_max_body_size 50m;
  14. sendfile on;
  15. tcp_nopush on;
  16. keepalive_timeout 60;
  17. tcp_nodelay on;
  18. fastcgi_connect_timeout 300;
  19. fastcgi_send_timeout 300;
  20. fastcgi_read_timeout 300;
  21. fastcgi_buffer_size 64k;
  22. fastcgi_buffers 4 64k;
  23. fastcgi_busy_buffers_size 128k;
  24. fastcgi_temp_file_write_size 256k;
  25. fastcgi_intercept_errors on;
  26. gzip on;
  27. gzip_min_length 1k;
  28. gzip_buffers 16 8k;
  29. gzip_http_version 1.1;
  30. gzip_comp_level 6;
  31. gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
  32. gzip_vary on;
  33. gzip_proxied expired no-cache no-store private auth;
  34. gzip_disable "MSIE [1-6]\.";
  35. limit_conn_zone $binary_remote_addr zone=perip:10m;
  36. limit_conn_zone $server_name zone=perserver:10m;
  37. server_tokens off;
  38. access_log off;
  39. server {
  40. listen 80;
  41. server_name ${NGINX_HOST};
  42. charset utf-8;
  43. location / {
  44. root html;
  45. index index.html index.htm;
  46. }
  47. location = /50x.html {
  48. root html;
  49. }
  50. location /api {
  51. proxy_set_header Host $host:$proxy_port;
  52. proxy_redirect off;
  53. proxy_set_header X-Real-IP $remote_addr;
  54. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  55. proxy_connect_timeout 60;
  56. proxy_read_timeout 600;
  57. proxy_send_timeout 600;
  58. proxy_pass ${DOCKER_REQUEST_DOMAIN_PREFIX};
  59. }
  60. }
  61. }