kanboard.conf 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. map $sent_http_content_type $expires {
  16. default off;
  17. text/html epoch;
  18. text/css max;
  19. application/javascript max;
  20. ~image/ max;
  21. }
  22. upstream kanboard {
  23. server kanboard-service-dockerbunker:80;
  24. }
  25. server {
  26. listen 80;
  27. server_name ${SERVICE_DOMAIN};
  28. return 301 https://$host$request_uri;
  29. }
  30. server {
  31. listen 443 ssl;
  32. server_name ${SERVICE_DOMAIN};
  33. ssl_certificate /etc/nginx/ssl/${SERVICE_DOMAIN}/cert.pem;
  34. ssl_certificate_key /etc/nginx/ssl/${SERVICE_DOMAIN}/key.pem;
  35. include /etc/nginx/includes/ssl.conf;
  36. add_header Strict-Transport-Security "max-age=15768000; includeSubDomains";
  37. add_header X-Frame-Options SAMEORIGIN;
  38. add_header X-XSS-Protection "1; mode=block";
  39. include /etc/nginx/includes/gzip.conf;
  40. location / {
  41. proxy_pass http://kanboard/;
  42. }
  43. expires $expires;
  44. # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
  45. location ~ /\. {
  46. deny all;
  47. access_log off;
  48. log_not_found off;
  49. }
  50. location ^~ /.well-known/ {
  51. access_log off;
  52. log_not_found off;
  53. root /var/www/html;
  54. # autoindex off;
  55. index index.html; # "no-such-file.txt",if expected protos don't need it
  56. try_files $uri $uri/ =404;
  57. }
  58. }