|
| 1 | +{{- if .Values.cachingNginx.enabled }} |
| 2 | +apiVersion: v1 |
| 3 | +kind: ConfigMap |
| 4 | +metadata: |
| 5 | + name: {{ template "verdaccio.fullname" . }}-nginx-config |
| 6 | +data: |
| 7 | + nginx.conf: | |
| 8 | + user nginx; |
| 9 | + worker_processes 4; |
| 10 | + pid /var/run/nginx.pid; |
| 11 | + error_log /dev/stderr info; |
| 12 | + events { |
| 13 | + worker_connections 10240; |
| 14 | + use epoll; |
| 15 | + } |
| 16 | + http { |
| 17 | + include /etc/nginx/mime.types; |
| 18 | + default_type application/octet-stream; |
| 19 | + server_names_hash_max_size 512; |
| 20 | + server_names_hash_bucket_size 64; |
| 21 | + sendfile on; |
| 22 | + tcp_nopush on; |
| 23 | + tcp_nodelay on; |
| 24 | + proxy_buffer_size 4k; |
| 25 | + proxy_buffers 1024 4k; |
| 26 | + proxy_read_timeout 2m; |
| 27 | + proxy_send_timeout 2m; |
| 28 | + fastcgi_buffer_size 4k; |
| 29 | + fastcgi_buffers 1024 4k; |
| 30 | + keepalive_timeout 10; |
| 31 | + keepalive_requests 100; |
| 32 | + reset_timedout_connection on; |
| 33 | + client_max_body_size 100m; |
| 34 | + gzip on; |
| 35 | + gzip_types text/css application/x-javascript application/javascript text/javascript text/plain; |
| 36 | + gzip_comp_level 6; |
| 37 | + gzip_min_length 100; |
| 38 | + gzip_http_version 1.0; |
| 39 | + gzip_proxied any; |
| 40 | + gzip_disable "msie6"; |
| 41 | + gzip_vary on; |
| 42 | + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; |
| 43 | + ssl_ciphers 'EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+RC4:EECDH:EDH+aRSA:RC4:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4'; |
| 44 | + ssl_session_cache shared:SSL:10m; |
| 45 | + ssl_session_timeout 30m; |
| 46 | + ssl_buffer_size 4k; |
| 47 | + ssl_prefer_server_ciphers on; |
| 48 | + ssl_session_tickets off; |
| 49 | + log_format main escape=json |
| 50 | + '{' |
| 51 | + '"time_local":"$time_local",' |
| 52 | + '"remote_addr":"$remote_addr",' |
| 53 | + '"remote_user":"$remote_user",' |
| 54 | + '"request":"$request",' |
| 55 | + '"status": "$status",' |
| 56 | + '"body_bytes_sent":"$body_bytes_sent",' |
| 57 | + '"request_time":"$request_time",' |
| 58 | + '"http_referrer":"$http_referer",' |
| 59 | + '"http_user_agent":"$http_user_agent"' |
| 60 | + '}'; |
| 61 | + access_log /dev/stdout main; |
| 62 | + real_ip_header X-Real-IP; |
| 63 | + set_real_ip_from 0.0.0.0/0; |
| 64 | + proxy_cache_path {{ .Values.cachingNginx.proxyCachePath }} |
| 65 | + include /etc/nginx/conf.d/*.conf; |
| 66 | + } |
| 67 | + default.conf: | |
| 68 | + server { |
| 69 | + listen 80; |
| 70 | + location / { |
| 71 | + proxy_pass http://127.0.0.1:4873; |
| 72 | + proxy_http_version 1.1; |
| 73 | + proxy_set_header Upgrade $http_upgrade; |
| 74 | + proxy_set_header Connection 'upgrade'; |
| 75 | + proxy_set_header Host $host; |
| 76 | + } |
| 77 | + } |
| 78 | +{{- end }} |
0 commit comments