nginx-configmap.yaml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: "nginx-configuration"
  5. data:
  6. protocol: {{ include "nginx.scheme" . }}
  7. nginx.conf: |-
  8. events {}
  9. http {
  10. # redirects all http requests to https requests
  11. server {
  12. listen 8000 default_server;
  13. listen [::]:8000 default_server;
  14. return 301 https://$host$request_uri;
  15. }
  16. server {
  17. server_name localhost;
  18. listen 443 ssl http2;
  19. listen [::]:433 ssl http2;
  20. ssl_certificate '/etc/nginx-certs/public.crt';
  21. ssl_certificate_key '/etc/nginx-certs/private.key';
  22. # maximum 3GB Upload File; change to fit your needs
  23. client_max_body_size 3G;
  24. add_header Strict-Transport-Security "max-age=15552000; includeSubDomains; preload" always;
  25. location = /robots.txt {
  26. allow all;
  27. log_not_found off;
  28. access_log off;
  29. }
  30. location = /.well-known/carddav {
  31. return 301 $scheme://$host/remote.php/dav;
  32. }
  33. location = /.well-known/caldav {
  34. return 301 $scheme://$host/remote.php/dav;
  35. }
  36. location / {
  37. proxy_pass http://localhost;
  38. proxy_http_version 1.1;
  39. proxy_cache_bypass $http_upgrade;
  40. proxy_request_buffering off;
  41. # Proxy headers
  42. proxy_set_header Upgrade $http_upgrade;
  43. proxy_set_header Connection "upgrade";
  44. proxy_set_header Host $http_host;
  45. proxy_set_header X-Real-IP $remote_addr;
  46. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  47. proxy_set_header X-Forwarded-Proto https;
  48. proxy_set_header X-Forwarded-Host $host;
  49. proxy_set_header X-Forwarded-Port $server_port;
  50. # Proxy timeouts
  51. proxy_connect_timeout 60s;
  52. proxy_send_timeout 60s;
  53. proxy_read_timeout 60s;
  54. }
  55. }
  56. }