nginx-snippets.conf.tmpl (2105B)
1 root /var/www/html; 2 3 location / { 4 try_files $uri /static/$uri @portal; 5 } 6 7 location /admin_api { 8 try_files none @prosody; 9 } 10 11 location /invites_api { 12 try_files none @prosody; 13 } 14 15 location /invites_bootstrap { 16 try_files none @prosody; 17 } 18 19 location /share { 20 alias /usr/share/javascript; 21 } 22 23 location /upload { 24 client_max_body_size 104857616; # 100MB + 16 bytes (see Prosody config) 25 proxy_request_buffering off; 26 proxy_http_version 1.1; 27 try_files none @prosody; 28 } 29 30 location /http-bind { 31 try_files none @prosodyws; 32 } 33 34 location /xmpp-websocket { 35 try_files none @prosodyws; 36 } 37 38 location = /.well-known/host-meta { 39 try_files none @prosody; 40 } 41 42 location = /.well-known/host-meta.json { 43 try_files none @prosody; 44 } 45 46 location @portal { 47 proxy_pass http://{{ env "NOMAD_ADDR_portal" }}; 48 proxy_set_header Host $host; 49 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 50 proxy_set_header X-Forwarded-Proto https; 51 } 52 53 location @prosody { 54 proxy_pass http://{{ env "NOMAD_ADDR_prosody" }}; 55 proxy_set_header Host $host; 56 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 57 proxy_set_header X-Forwarded-Proto https; 58 } 59 60 location @prosodyws { 61 proxy_pass http://{{ env "NOMAD_ADDR_prosody" }}; 62 proxy_http_version 1.1; 63 proxy_set_header Host $host; 64 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 65 proxy_set_header X-Forwarded-Proto https; 66 proxy_set_header Connection $http_connection; 67 proxy_set_header Upgrade $http_upgrade; 68 69 proxy_read_timeout 900s; 70 } 71 72 location /_health/portal { 73 proxy_pass http://{{ env "NOMAD_ADDR_portal" }}/_health; 74 proxy_set_header Host $host; 75 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 76 proxy_set_header X-Forwarded-Proto https; 77 } 78 79 location /_health/xmpp { 80 proxy_pass http://{{ env "NOMAD_ADDR_prosody" }}/host_status_check; 81 proxy_set_header Host $host; 82 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 83 proxy_set_header X-Forwarded-Proto https; 84 } 85 86 error_page 502 /_errors/502.html; 87 error_page 503 /_errors/503.html; 88 error_page 504 /_errors/504.html;