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.

37 lines
1.0 KiB

8 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 target != 'prod' %}
  23. include snippets/banner_{{ target }}.conf;
  24. {%- endif %}
  25. }
  26. {%- if service.app == 'odoo15' or service.app == 'odoo12' %}
  27. location /longpolling {
  28. proxy_pass http://{{ service.container }}:{{ service.port + 1000 }};
  29. }
  30. {%- endif %}
  31. }
  32. {% endfor %}