kea-nginx.conf 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # This file contains an example configuration of the nginx HTTP server.
  2. # nginx is configured as a reverse proxy for Kea RESTful API. It enables
  3. # HTTPS for Kea to provide secure comunication and client side
  4. # certificate verification to allow only authorized clients to
  5. # access the Kea RESTful API.
  6. events {
  7. }
  8. # Minimal HTTPS server configuration for Kea.
  9. #
  10. # Note: in order to generate self signed certificates the following
  11. # command can be used.
  12. #
  13. # Client certificate and key:
  14. # openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout \
  15. # kea-client.key -out kea-client.crt
  16. #
  17. # Server certificate and key:
  18. # openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout \
  19. # kea-rest.key -out key-rest.crt
  20. #
  21. # Then start the HTTPS server:
  22. # nginx -c /path/to/kea-nginx.conf start
  23. #
  24. # In order to test the configuration with curl:
  25. # curl -k --key ./kea-client.key --cert ./kea-client.crt -X POST \
  26. # -H Content-Type:application/json -d '{ "command": "list-commands" }' \
  27. # https://kea.example.org/kea
  28. #
  29. http {
  30. # HTTPS server
  31. #
  32. server {
  33. # Use default HTTPS default port.
  34. listen 443 ssl;
  35. # Set server name.
  36. server_name kea.example.org;
  37. # Server certificate and key.
  38. ssl_certificate kea-rest.crt;
  39. ssl_certificate_key kea-rest.key;
  40. # Client certificate which must be sent by the client to be
  41. # authorized.
  42. ssl_client_certificate kea-client.crt;
  43. # Enable verification of the client certificate.
  44. ssl_verify_client on;
  45. # For URLs such as https://kea.example.org/kea, forward the
  46. # requests to http://127.0.0.1:8080.
  47. location /kea {
  48. proxy_pass http://127.0.0.1:8080;
  49. }
  50. }
  51. }