server {
    listen 8080;
    root /usr/share/nginx/html;
    index index.html;

    sub_filter_once off;
    sub_filter_types text/html;
    sub_filter '<body>' '<link rel="stylesheet" href="/theme.css"><body>';
    sub_filter 'gamja IRC client' 'chat.irc.now';

    location /socket {
        proxy_pass http://josie.irc-josie-cloud.svc.cluster.local:8080/;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 600s;
        proxy_send_timeout 600s;
    }

    location / {
        try_files $uri $uri/ /index.html;
    }
}
