nginxconf.yaml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. apiVersion: v1
  2. data:
  3. nginx.cnf: |-
  4. worker_processes 1;
  5. events { worker_connections 1024; }
  6. http {
  7. sendfile on;
  8. server {
  9. listen 80;
  10. # a test endpoint that returns http 200s
  11. location / {
  12. proxy_pass http://httpstat.us/200;
  13. proxy_set_header X-Real-IP $remote_addr;
  14. }
  15. }
  16. server {
  17. listen 80;
  18. server_name api.hello.world;
  19. location / {
  20. proxy_pass http://l5d.default.svc.cluster.local;
  21. proxy_set_header Host $host;
  22. proxy_set_header Connection "";
  23. proxy_http_version 1.1;
  24. more_clear_input_headers 'l5d-ctx-*' 'l5d-dtab' 'l5d-sample';
  25. }
  26. }
  27. server {
  28. listen 80;
  29. server_name www.hello.world;
  30. location / {
  31. # allow 'employees' to perform dtab overrides
  32. if ($cookie_special_employee_cookie != "letmein") {
  33. more_clear_input_headers 'l5d-ctx-*' 'l5d-dtab' 'l5d-sample';
  34. }
  35. # add a dtab override to get people to our beta, world-v2
  36. set $xheader "";
  37. if ($cookie_special_employee_cookie ~* "dogfood") {
  38. set $xheader "/host/world => /srv/world-v2;";
  39. }
  40. proxy_set_header 'l5d-dtab' $xheader;
  41. proxy_pass http://l5d.default.svc.cluster.local;
  42. proxy_set_header Host $host;
  43. proxy_set_header Connection "";
  44. proxy_http_version 1.1;
  45. }
  46. }
  47. }
  48. kind: ConfigMap
  49. metadata:
  50. name: nginx-config