piwik.conf 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. map $sent_http_content_type $expires {
  2. default off;
  3. text/html epoch;
  4. text/css max;
  5. application/javascript max;
  6. ~image/ max;
  7. }
  8. upstream piwik {
  9. server piwik-service-dockerbunker:80;
  10. }
  11. server {
  12. listen 80;
  13. server_name ${SERVICE_DOMAIN};
  14. return 301 https://$host$request_uri;
  15. }
  16. server {
  17. listen 443;
  18. server_name ${SERVICE_DOMAIN};
  19. ssl on;
  20. ssl_certificate /etc/nginx/ssl/${SERVICE_DOMAIN}/cert.pem;
  21. ssl_certificate_key /etc/nginx/ssl/${SERVICE_DOMAIN}/key.pem;
  22. include /etc/nginx/includes/ssl.conf;
  23. add_header Strict-Transport-Security "max-age=15768000; includeSubDomains";
  24. add_header X-Frame-Options SAMEORIGIN;
  25. add_header X-XSS-Protection "1; mode=block";
  26. proxy_set_header X-Real-IP $remote_addr;
  27. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  28. proxy_set_header Host $http_host;
  29. include /etc/nginx/includes/gzip.conf;
  30. location / {
  31. proxy_pass http://piwik/;
  32. }
  33. expires $expires;
  34. location = /favicon.ico {
  35. log_not_found off;
  36. access_log off;
  37. }
  38. location ^~ /.well-known/ {
  39. access_log off;
  40. log_not_found off;
  41. root /var/www/html;
  42. # autoindex off;
  43. index index.html; # "no-such-file.txt",if expected protos don't need it
  44. try_files $uri $uri/ =404;
  45. }
  46. }