nginx-configmap.yaml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. location = /robots.txt {
  25. allow all;
  26. log_not_found off;
  27. access_log off;
  28. }
  29. location = /.well-known/carddav {
  30. return 301 $scheme://$host/remote.php/dav;
  31. }
  32. location = /.well-known/caldav {
  33. return 301 $scheme://$host/remote.php/dav;
  34. }
  35. location / {
  36. proxy_pass http://localhost;
  37. proxy_http_version 1.1;
  38. proxy_cache_bypass $http_upgrade;
  39. proxy_request_buffering off;
  40. # Proxy headers
  41. proxy_set_header Upgrade $http_upgrade;
  42. proxy_set_header Connection "upgrade";
  43. proxy_set_header Host $http_host;
  44. proxy_set_header X-Real-IP $remote_addr;
  45. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  46. proxy_set_header X-Forwarded-Proto https;
  47. proxy_set_header X-Forwarded-Host $host;
  48. proxy_set_header X-Forwarded-Port $server_port;
  49. # Proxy timeouts
  50. proxy_connect_timeout 60s;
  51. proxy_send_timeout 60s;
  52. proxy_read_timeout 60s;
  53. }
  54. }
  55. }