<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://baszerr.eu/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>BaSzErr - blog:2024:08:19</title>
        <description></description>
        <link>https://baszerr.eu/</link>
        <lastBuildDate>Thu, 30 Apr 2026 08:18:11 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://baszerr.eu/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
            <title>BaSzErr</title>
            <link>https://baszerr.eu/</link>
        </image>
        <item>
            <title>2024-08-19_-_websockets_reverse_proxy_with_nginx</title>
            <link>https://baszerr.eu/doku.php?id=blog:2024:08:19:2024-08-19_-_websockets_reverse_proxy_with_nginx</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;websockets_reverse_proxy_with_nginx&quot;&gt;2024-08-19 - websockets reverse proxy with nginx&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
recently i bought &lt;a href=&quot;https://vorondesign.com&quot; class=&quot;urlextern&quot; title=&quot;https://vorondesign.com&quot; rel=&quot;ugc nofollow&quot;&gt;Voron 2.4&lt;/a&gt; 350x350mm &lt;a href=&quot;https://docs.ldomotors.com/en/voron/voron2&quot; class=&quot;urlextern&quot; title=&quot;https://docs.ldomotors.com/en/voron/voron2&quot; rel=&quot;ugc nofollow&quot;&gt;kit from LDO&lt;/a&gt;, took a week off from work and started assembly. that felt awesome – sth like lego bricks for adults. :D but that&amp;#039;s a story for another day. in order to make sure i not only understand the whole mechanics and wiring, but also the software side i&amp;#039;ve decided to prepare my own setup for these.
&lt;/p&gt;

&lt;p&gt;
since the stack differs significantly from good old &lt;a href=&quot;https://marlinfw.org&quot; class=&quot;urlextern&quot; title=&quot;https://marlinfw.org&quot; rel=&quot;ugc nofollow&quot;&gt;marlin&lt;/a&gt; i&amp;#039;m used to, i had to familiarize myself with: &lt;a href=&quot;https://www.klipper3d.org&quot; class=&quot;urlextern&quot; title=&quot;https://www.klipper3d.org&quot; rel=&quot;ugc nofollow&quot;&gt;klipper&lt;/a&gt;, &lt;a href=&quot;https://moonraker.readthedocs.io&quot; class=&quot;urlextern&quot; title=&quot;https://moonraker.readthedocs.io&quot; rel=&quot;ugc nofollow&quot;&gt;moonraker&lt;/a&gt;, &lt;a href=&quot;https://fluidd.xyz&quot; class=&quot;urlextern&quot; title=&quot;https://fluidd.xyz&quot; rel=&quot;ugc nofollow&quot;&gt;fluidd&lt;/a&gt;, etc… i&amp;#039;ve put up &lt;a href=&quot;https://github.com/el-bart/Voron_stuff&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/el-bart/Voron_stuff&quot; rel=&quot;ugc nofollow&quot;&gt;Voron stuff&lt;/a&gt; repo on GH, to stockpile all configs, mods, etc. again – story for a different day.
&lt;/p&gt;

&lt;p&gt;
today i&amp;#039;ll just describe sth that took ~1-2h of my time, trying to understand why i cannot connect with &lt;code&gt;fluidd&lt;/code&gt; to &lt;code&gt;moonraker&lt;/code&gt; for a long time… with a help of developers tools in the browser i&amp;#039;ve realized that the connection is done using websockets (&lt;code&gt;ws://foo.bar&lt;/code&gt;). for security reasons i used &lt;a href=&quot;https://nginx.org&quot; class=&quot;urlextern&quot; title=&quot;https://nginx.org&quot; rel=&quot;ugc nofollow&quot;&gt;nginx&lt;/a&gt; as a &lt;a href=&quot;https://en.wikipedia.org/wiki/reverse proxy&quot; class=&quot;interwiki iw_wp&quot; title=&quot;https://en.wikipedia.org/wiki/reverse proxy&quot;&gt;reverse proxy&lt;/a&gt; (HTTPS, perfect forward secrecy, etc.) for both… and it turned out that websockets are not forwarded with a regular, default RE config:
&lt;/p&gt;
&lt;pre class=&quot;code nginx&quot;&gt;    &lt;a href=&quot;http://wiki.nginx.org/NginxHttpCoreModule#location&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;location&lt;/span&gt;&lt;/a&gt; / &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;a href=&quot;http://wiki.nginx.org/NginxHttpProxyModule#proxy_pass&quot;&gt;&lt;span class=&quot;kw23&quot;&gt;proxy_pass&lt;/span&gt;&lt;/a&gt; &lt;a href=&quot;http://wiki.nginx.org/NginxHttpCoreModule#http&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;http&lt;/span&gt;&lt;/a&gt;://moonraker:7125&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;# DNS from docker&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
&lt;abbr title=&quot;Too long; didn&amp;#039;t read&quot;&gt;TL;DR&lt;/abbr&gt; the missing part was explicit websocket forward via:
&lt;/p&gt;
&lt;pre class=&quot;code nginx&quot;&gt;    &lt;a href=&quot;http://wiki.nginx.org/NginxHttpCoreModule#location&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;location&lt;/span&gt;&lt;/a&gt; /websocket &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;a href=&quot;http://wiki.nginx.org/NginxHttpProxyModule#proxy_pass&quot;&gt;&lt;span class=&quot;kw23&quot;&gt;proxy_pass&lt;/span&gt;&lt;/a&gt; &lt;a href=&quot;http://wiki.nginx.org/NginxHttpCoreModule#http&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;http&lt;/span&gt;&lt;/a&gt;://moonraker:7125&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;a href=&quot;http://wiki.nginx.org/NginxHttpProxyModule#proxy_http_version&quot;&gt;&lt;span class=&quot;kw23&quot;&gt;proxy_http_version&lt;/span&gt;&lt;/a&gt; 1.1&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;a href=&quot;http://wiki.nginx.org/NginxHttpProxyModule#proxy_set_header&quot;&gt;&lt;span class=&quot;kw23&quot;&gt;proxy_set_header&lt;/span&gt;&lt;/a&gt; Upgrade &lt;span class=&quot;re0&quot;&gt;$http_upgrade&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;a href=&quot;http://wiki.nginx.org/NginxHttpProxyModule#proxy_set_header&quot;&gt;&lt;span class=&quot;kw23&quot;&gt;proxy_set_header&lt;/span&gt;&lt;/a&gt; Connection &lt;span class=&quot;st0&quot;&gt;&amp;quot;upgrade&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;a href=&quot;http://wiki.nginx.org/NginxHttpProxyModule#proxy_read_timeout&quot;&gt;&lt;span class=&quot;kw23&quot;&gt;proxy_read_timeout&lt;/span&gt;&lt;/a&gt; 86400&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
on top of that make sure that large files can be transferred (read: &lt;a href=&quot;https://en.wikipedia.org/wiki/g-code&quot; class=&quot;interwiki iw_wp&quot; title=&quot;https://en.wikipedia.org/wiki/g-code&quot;&gt;g-code&lt;/a&gt; files):
&lt;/p&gt;
&lt;pre class=&quot;code nginx&quot;&gt;    &lt;a href=&quot;http://wiki.nginx.org/NginxHttpCoreModule#client_max_body_size&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;client_max_body_size&lt;/span&gt;&lt;/a&gt; 1024M&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
with these changes it all worked like a charm! :) sth worth remembering for the future, for sure. you&amp;#039;re welcome. ;)
&lt;/p&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 19 Aug 2024 07:00:33 +0000</pubDate>
        </item>
    </channel>
</rss>
