# some doc: https://www.nginx.com/resources/wiki/start/topics/examples/full/ error_log /dev/stderr; events {} http { access_log /dev/stdout; server_names_hash_bucket_size 64; server { listen 0.0.0.0:{{ env "NOMAD_PORT_https_port" }} ssl http2 default_server; listen [::]:{{ env "NOMAD_PORT_https_port" }} ssl http2 default_server; server_name _; ssl_certificate /etc/nginx/jitsi.crt; ssl_certificate_key /etc/nginx/jitsi.key; root /srv/jitsi-meet; index index.html; # lot of work would be needed to improve location rules # - in order to allow - and _ in the URL, even space # - while not shadowing other files (.js and following locations) # - passed some times twice on the problem, not as easy as it seems location ~ ^/([a-zA-Z0-9=\?]+)$ { rewrite ^/(.*)$ / break; } location / { ssi on; } location /external_api.js { alias /srv/jitsi-meet/libs/external_api.min.js; } location /http-bind { # We add CORS to use a different frontend which is useful for load testing as we do not want to advertise too much our URL add_header 'Access-Control-Allow-Headers' 'content-type'; add_header 'Access-Control-Allow-Methods' 'GET,POST,PUT,DELETE,OPTIONS'; add_header 'Access-Control-Allow-Origin' '*'; proxy_pass http://{{ env "NOMAD_ADDR_bosh_port" }}/http-bind; proxy_set_header X-Forwarded-For \$remote_addr; proxy_set_header Host \$http_host; } } }