provisioning tool for building opinionated architecture
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.2 KiB

9 months ago
1 month ago
9 months ago
1 month ago
9 months ago
  1. {% for service in expanded.services %}
  2. server {
  3. listen 443 http2 ssl;
  4. server_name {{ service.fqdn }};
  5. {%- if target == 'dev' %}
  6. include snippets/snakeoil.conf;
  7. {%- else %}
  8. ssl_certificate /etc/letsencrypt/live/{{ service.domain }}/fullchain.pem;
  9. ssl_certificate_key /etc/letsencrypt/live/{{ service.domain }}/privkey.pem;
  10. {%- endif %}
  11. location / {
  12. proxy_pass http://{{ service.container }}:{{ service.port }};
  13. {%- if service.app == 'odoo15' %}
  14. client_max_body_size 5M;
  15. {%- endif %}
  16. proxy_http_version 1.1;
  17. proxy_set_header X-Real-IP $remote_addr;
  18. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  19. proxy_set_header Host $http_host;
  20. proxy_set_header Upgrade $http_upgrade;
  21. proxy_set_header Connection "upgrade";
  22. {%- if services[service.domain][service.subdomain]['data']['nginx']['extra'] %}
  23. # From ... data.nginx.extra
  24. {{ services[service.domain][service.subdomain]['data']['nginx']['extra'] }}
  25. {%- endif %}
  26. {%- if target != 'prod' %}
  27. include snippets/banner_{{ target }}.conf;
  28. {%- endif %}
  29. }
  30. {%- if service.app == 'odoo15' or service.app == 'odoo12' %}
  31. location /longpolling {
  32. proxy_pass http://{{ service.container }}:{{ service.port + 1000 }};
  33. }
  34. {%- endif %}
  35. }
  36. {% endfor %}