nginx.conf 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # nginx.conf -- docker-openresty
  2. #
  3. # This file is installed to:
  4. # `/usr/local/openresty/nginx/conf/nginx.conf`
  5. # and is the file loaded by nginx at startup,
  6. # unless the user specifies otherwise.
  7. #
  8. # It tracks the upstream OpenResty's `nginx.conf`, but removes the `server`
  9. # section and adds this directive:
  10. # `include /etc/nginx/conf.d/*.conf;`
  11. #
  12. # The `docker-openresty` file `nginx.vh.default.conf` is copied to
  13. # `/etc/nginx/conf.d/default.conf`. It contains the `server section
  14. # of the upstream `nginx.conf`.
  15. #
  16. # See https://github.com/openresty/docker-openresty/blob/master/README.md#nginx-config-files
  17. #
  18. #user www;
  19. worker_processes 4;
  20. # Enables the use of JIT for regular expressions to speed-up their processing.
  21. pcre_jit on;
  22. #error_log logs/error.log;
  23. #error_log logs/error.log notice;
  24. #error_log logs/error.log info;
  25. pid /var/run/nginx.pid;
  26. daemon off;
  27. worker_rlimit_nofile 65535;
  28. events {
  29. use epoll;
  30. worker_connections 65535;
  31. multi_accept on;
  32. accept_mutex on;
  33. }
  34. http {
  35. include mime.types;
  36. default_type application/octet-stream;
  37. # Enables or disables the use of underscores in client request header fields.
  38. # When the use of underscores is disabled, request header fields whose names contain underscores are marked as invalid and become subject to the ignore_invalid_headers directive.
  39. # underscores_in_headers off;
  40. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  41. '$status $body_bytes_sent "$http_referer" '
  42. '"$http_user_agent" "$http_x_forwarded_for" "$host"';
  43. #access_log logs/access.log main;
  44. # Log in JSON Format
  45. # log_format nginxlog_json escape=json '{ "timestamp": "$time_iso8601", '
  46. # '"remote_addr": "$remote_addr", '
  47. # '"body_bytes_sent": $body_bytes_sent, '
  48. # '"request_time": $request_time, '
  49. # '"response_status": $status, '
  50. # '"request": "$request", '
  51. # '"request_method": "$request_method", '
  52. # '"host": "$host",'
  53. # '"upstream_addr": "$upstream_addr",'
  54. # '"http_x_forwarded_for": "$http_x_forwarded_for",'
  55. # '"http_referrer": "$http_referer", '
  56. # '"http_user_agent": "$http_user_agent", '
  57. # '"http_version": "$server_protocol", '
  58. # '"nginx_access": true }';
  59. # access_log /dev/stdout nginxlog_json;
  60. # See Move default writable paths to a dedicated directory (#119)
  61. # https://github.com/openresty/docker-openresty/issues/119
  62. client_body_temp_path /var/run/openresty/nginx-client-body;
  63. proxy_temp_path /var/run/openresty/nginx-proxy;
  64. fastcgi_temp_path /var/run/openresty/nginx-fastcgi;
  65. uwsgi_temp_path /var/run/openresty/nginx-uwsgi;
  66. scgi_temp_path /var/run/openresty/nginx-scgi;
  67. sendfile on;
  68. tcp_nopush on;
  69. tcp_nodelay on;
  70. #keepalive_timeout 0;
  71. keepalive_timeout 65;
  72. types_hash_max_size 2048;
  73. client_max_body_size 128M;
  74. gzip on;
  75. gzip_disable "msie6";
  76. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  77. ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
  78. #定义共享内存区域
  79. lua_shared_dict env_cache 10m;
  80. include /etc/nginx/sites-available/*.conf;
  81. # Don't reveal OpenResty version to clients.
  82. server_tokens off;
  83. charset UTF-8;
  84. }