nginx-configmap.yaml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: "nginx-configuration"
  5. data:
  6. config: |-
  7. http {
  8. # redirects all http requests to https requests
  9. server {
  10. listen 80 default_server;
  11. listen [::]:80 default_server;
  12. return 301 https://$host$request_uri;
  13. }
  14. server {
  15. server_name localhost;
  16. listen 443 ssl http2;
  17. listen [::]:433 ssl http2;
  18. ssl_certificate /etc/nginx/public.crt
  19. ssl_certificate_key /etc/nginx/private.key
  20. ssl_session_timeout 120m;
  21. ssl_session_cache shared:ssl:16m;
  22. ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
  23. ssl_prefer_server_ciphers on;
  24. ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA:EDH+aRSA:EECDH:!RC4:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS;
  25. add_header Strict-Transport-Security max-age=31536000;
  26. add_header X-Content-Type-Options nosniff;
  27. add_header X-XSS-Protection "1";
  28. # maximum 3GB Upload File; change to fit your needs
  29. client_max_body_size 3G;
  30. location / {
  31. # We clear this as we will be adding it in our reverse proxy
  32. more_clear_headers 'Strict-Transport-Security';
  33. proxy_pass http://localhost:80;
  34. # set proper x-forwarded-headers
  35. # proxy_set_header 'X-Forwarded-Host' nextcloud.domain.tld;
  36. # proxy_set_header 'X-Forwarded-Proto' https;
  37. # -For and -IP:
  38. # see https://stackoverflow.com/questions/19366090/what-is-the-difference-between-x-forwarded-for-and-x-forwarded-ip
  39. proxy_set_header 'X-Forwarded-For' $remote_addr;
  40. proxy_set_header 'X-Forwarded-IP' $remote_addr;
  41. }
  42. }
  43. }