server {
    listen 80;
    listen [::]:80;

    server_name CHAT.DOMAIN.ORG;

    root /var/www/xmpp-web

    location /xmpp-websocket {
        # Proxy traffic to XMPP websocket
        # Use port 5443 for wss (encrypted) connections
        #proxy_pass http://CHAT.DOMAIN.ORG:5443/xmpp-websocket; 
        proxy_pass http://CHAT.DOMAIN.ORG:5280/xmpp-websocket;

        # These allow websockets over http
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}