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.

45 lines
1.3 KiB

9 months ago
2 months ago
9 months ago
2 months ago
9 months ago
2 months 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 X-Forwarded-Proto https;
  20. proxy_set_header Host $http_host;
  21. proxy_set_header Upgrade $http_upgrade;
  22. proxy_set_header Connection "upgrade";
  23. {%- if services[service.domain][service.subdomain]['data']['nginx']['extra'] %}
  24. # From ... data.nginx.extra
  25. {{ services[service.domain][service.subdomain]['data']['nginx']['extra'] }}
  26. {%- endif %}
  27. {%- if target != 'prod' %}
  28. include snippets/banner_{{ target }}.conf;
  29. {%- endif %}
  30. }
  31. {%- if service.app == 'odoo15' or service.app == 'odoo12' %}
  32. location /longpolling {
  33. proxy_pass http://{{ service.container }}:{{ service.port + 1000 }};
  34. }
  35. {%- endif %}
  36. }
  37. {% endfor %}