kanboard.conf 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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;
  32. server_name ${SERVICE_DOMAIN};
  33. ssl on;
  34. ssl_certificate /etc/nginx/ssl/${SERVICE_DOMAIN}/cert.pem;
  35. ssl_certificate_key /etc/nginx/ssl/${SERVICE_DOMAIN}/key.pem;
  36. include /etc/nginx/includes/ssl.conf;
  37. add_header Strict-Transport-Security "max-age=15768000; includeSubDomains";
  38. add_header X-Frame-Options SAMEORIGIN;
  39. add_header X-XSS-Protection "1; mode=block";
  40. include /etc/nginx/includes/gzip.conf;
  41. location / {
  42. proxy_pass http://kanboard/;
  43. }
  44. expires $expires;
  45. # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
  46. location ~ /\. {
  47. deny all;
  48. access_log off;
  49. log_not_found off;
  50. }
  51. location ^~ /.well-known/ {
  52. access_log off;
  53. log_not_found off;
  54. root /var/www/html;
  55. # autoindex off;
  56. index index.html; # "no-such-file.txt",if expected protos don't need it
  57. try_files $uri $uri/ =404;
  58. }
  59. }