<path d="M50.5,0.5c-27.614,0-50,22.386-50,50c0,27.614,22.386,50,50,50s50-\
22.386,50-50C100.5,22.886,78.114,0.5,50.5,0.5z M60.5,85.5h-20v-40h20V85.5z \
M50.5,35.5c-5.523,0-10-4.477-10-10s4.477-10,10-10c5.522,0,10,4.477,10,\
-10S56.022,35.5,50.5,35.5z"/></svg>`;
+10S56.022,35.5,50.5,35.5z" fill="darkgrey"/></svg>`;
const stopIcon = h('div', { id: 'upRightStop', onclick: confirmStopGame });
- stopIcon.innerHTML = `<svg viewBox="0 0 533.333 533.333" xmlns="http://www.w3.org/2000/svg">
-<path d="M528.468,428.468 L366.667,266.666 L528.462,104.869 C533.227,100.104 533.227,92.373 528.462,87.608 L445.725,4.871 C440.96,-0.106 433.229,-0.106 428.464,4.871 L266.667,166.668 L104.87,4.871 C100.105,-0.106 92.374,-0.106 87.609,4.871 L4.872,87.608 C-0.105,92.373 -0.105,100.104 4.872,104.869 L166.669,266.666 L4.872,428.463 C-0.105,433.228 -0.105,440.959 4.872,445.724 L87.609,528.461 C92.374,533.226 100.105,533.226 104.87,528.461 L266.667,366.664 L428.464,528.461 C433.229,533.226 440.96,533.226 445.725,528.461 L528.462,445.724 C533.227,440.959 533.227,433.228 528.468,428.468 Z" fill="currentColor"/>
+ stopIcon.innerHTML = `<svg viewBox="0 0 533.333 533.333">\
+<path d="M528.468,428.468 L366.667,266.666 L528.462,104.869 C533.227,\
+100.104 533.227,92.373 528.462,87.608 L445.725,4.871 C440.96,-0.106 433.229,\
+-0.106 428.464,4.871 L266.667,166.668 L104.87,4.871 C100.105,-0.106 92.374,\
+-0.106 87.609,4.871 L4.872,87.608 C-0.105,92.373 -0.105,100.104 4.872,104.869 \
+L166.669,266.666 L4.872,428.463 C-0.105,433.228 -0.105,440.959 4.872,445.724 \
+L87.609,528.461 C92.374,533.226 100.105,533.226 104.87,528.461 L266.667,\
+366.664 L428.464,528.461 C433.229,533.226 440.96,533.226 445.725,528.461 \
+L528.462,445.724 C533.227,440.959 533.227,433.228 528.468,428.468 Z"
+fill="darkgrey"/>
</svg>`;
const board = h('div', { class: 'chessboard' });
error_log /var/log/nginx/xogo_error.log;
access_log /var/log/nginx/xogo_access.log;
- # 1. Entry point: always check if there was an update
- location = /index.html {
+ #
+ # Entry point: always revalidate
+ #
+ location ~* ^/(index\.html|manifest\.json)$ {
add_header Cache-Control "no-cache, must-revalidate";
- expires 0;
}
- # 2. Static hashed files (JS, CSS) + assets: agressive caching
- location / {
- try_files $uri $uri/ /index.html;
+ #
+ # Static hashed assets
+ #
+ location ~* \.(js|css|html|png|jpg|svg|ico|ttf)$ {
expires 1y;
add_header Cache-Control "public, immutable";
+ try_files $uri =404;
}
- # 3. WebSocket server proxy
+ #
+ # WebSocket server proxy
+ #
location /ws {
proxy_pass http://localhost:WS_PORT;
proxy_http_version 1.1;
proxy_buffering off;
}
+ #
+ # SPA fallback
+ #
+ location / {
+ try_files $uri $uri/ /index.html;
+ }
+
ssl_certificate /etc/letsencrypt/live/my.server.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/my.server.com/privkey.pem;
}