civetweb.conf 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # Instructions to run (on Linux) to reproduce test results:
  2. #
  3. # 1) copy civetweb executable here (examples/https directory)
  4. # 2) sudo ./civetweb
  5. #
  6. # Instructions to adapt to your own server:
  7. #
  8. # 1) generate your own server cert
  9. # 2) generate at least one backup server cert
  10. # in case you want a self signed cert, you can use the script
  11. # in resources/cert for both steps
  12. # 3) copy the content of the *.pin files into the Public-Key-Pins
  13. # header config (the base64 encoded certificate hash)
  14. # 4) set the document root, and all other required http server settings
  15. # 5) Run the tests from the three websites below. They will tell you
  16. # also what clients are compatible with your settings. The settings
  17. # here are very strict and lock out most older clients/browsers.
  18. # You will find some hints for fine tuning there as well.
  19. # 6) If you know all your clients, and give them client certificates in
  20. # advance, you can significantly improve security by setting
  21. # "ssl_verify_peer" to "yes" and specifying a client cert (directory)
  22. # using "ssl_ca_file/path". This will lock out all clients without a
  23. # proper certificate. Don't use it for your public home page, but
  24. # consider it for your private remote access server.
  25. # 7) run civetweb, like above - or better create your own start script
  26. # You are welcome to share your thoughts and experience on GitHub
  27. # (see README.md in CivetWeb main directory).
  28. # Don't run as super user, switch back to a regular user
  29. run_as_user user
  30. # The standard HTTP port 80 should redirect to the standard HTTPS port 443
  31. listening_ports 80r,443s
  32. # Don't forget to set the document root and domain
  33. #document_root tdb
  34. #authentication_domain mydomain.com
  35. # Optional fallback document root, checked for file-paths not found in document_root
  36. #fallback_document_root tdb_fallback
  37. # Set the a certificate
  38. ssl_certificate ../../resources/cert/server.pem
  39. # Require a client cert for your private server (see above)
  40. #ssl_verify_peer yes
  41. #ssl_ca_file ../../resources/cert/client.pem
  42. # Enforce TLS1.2 and some strong cipher(s)
  43. ssl_protocol_version 4
  44. ssl_cipher_list ECDH+AESGCM+AES256:!aNULL:!MD5:!DSS
  45. # Tell all browsers to access this site only as HTTPS for the next 180 days
  46. strict_transport_security_max_age 15552000
  47. # Set some HTTP security header, see https://securityheaders.io
  48. additional_header Content-Security-Policy: script-src 'self'
  49. additional_header X-Frame-Options: SAMEORIGIN
  50. additional_header X-Xss-Protection: 1; mode=block
  51. additional_header X-Content-Type-Options: nosniff
  52. additional_header Referrer-Policy: same-origin
  53. additional_header Public-Key-Pins: pin-sha256="uz1UTAPen+xb+UoQqkVlEx4H653LbMjfRJcZx5OrjbI="; pin-sha256="pf3px1MBPmlTGAPoiHWqaSJ9L9Z+DKfwgsU7LfLnmsk="; max-age=7776000
  54. #additional_header Expect-CT: max-age=86400,report-uri="https://mydomain.com/report"
  55. # Ratings from 2017-09-03 (tests performed later may require more
  56. # strict security settings)
  57. #
  58. # Headers rated A+ from https://securityheaders.io/
  59. #
  60. # SSL rated B from https://www.htbridge.com/ssl when using a self signed
  61. # certificate, but no other weaknesses for modern browsers.
  62. # Site remarks some older TLS versions and some weaker ciphers are not
  63. # supported (but that's accessibility, not security).
  64. #
  65. # HTTPS rated A+ from https://www.htbridge.com/websec/ when using a self
  66. # signed certificate, generated with make_certs.sh in resources/cert/
  67. # and adding the server.pin and server_bkup.pin content into the
  68. # Public-Key-Pins header above.
  69. #
  70. # A rating of "T / If trust issues are ignored: A" (ignoring self-signed cert)
  71. # from https://www.ssllabs.com/ssltest/, https://www.qualys.com/forms/freescan/
  72. # (Note: this test is runs with reverse DNS name, while all others use the
  73. # IP address).
  74. #
  75. # Note: This settings are very strict and prevent some older but still common
  76. # versions of major browsers to access this site. The test web sites will give
  77. # you an overview. Test, before you use this settings.