nextcloud.conf 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ##
  2. # You should look at the following URL's in order to grasp a solid understanding
  3. # of Nginx configuration files in order to fully unleash the power of Nginx.
  4. # http://wiki.nginx.org/Pitfalls
  5. # http://wiki.nginx.org/QuickStart
  6. # http://wiki.nginx.org/Configuration
  7. #
  8. # Generally, you will want to move this file somewhere, and start with a clean
  9. # file but keep this around for reference. Or just disable in sites-enabled.
  10. #
  11. # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
  12. ##
  13. # Default server configuration
  14. #
  15. upstream nextcloud {
  16. server nextcloud-service-dockerbunker:80;
  17. }
  18. server {
  19. listen 80;
  20. server_name ${SERVICE_DOMAIN};
  21. return 301 https://$host$request_uri;
  22. add_header X-Content-Type-Options "nosniff" always;
  23. add_header X-XSS-Protection "1; mode=block" always;
  24. add_header X-Frame-Options "DENY" always;
  25. add_header Referrer-Policy "strict-origin" always;
  26. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
  27. server_tokens off;
  28. }
  29. server {
  30. listen 443 ssl;
  31. server_name ${SERVICE_DOMAIN};
  32. ssl_certificate /etc/nginx/ssl/${SERVICE_DOMAIN}/cert.pem;
  33. ssl_certificate_key /etc/nginx/ssl/${SERVICE_DOMAIN}/key.pem;
  34. include /etc/nginx/includes/ssl.conf;
  35. add_header X-Content-Type-Options "nosniff" always;
  36. add_header X-XSS-Protection "1; mode=block" always;
  37. add_header X-Frame-Options "DENY" always;
  38. add_header Referrer-Policy "strict-origin" always;
  39. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
  40. server_tokens off;
  41. include /etc/nginx/includes/gzip.conf;
  42. location / {
  43. proxy_pass http://nextcloud/;
  44. proxy_set_header Host $http_host; # required for docker client's sake
  45. proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP
  46. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  47. proxy_set_header X-Forwarded-Proto $scheme;
  48. proxy_read_timeout 900;
  49. }
  50. location ~ /.well-known {
  51. allow all;
  52. root /var/www/html;
  53. }
  54. }