You are reading a single comment by @Velocio and its replies. Click here to read the full conversation.
  • @cyclotron3k I think I have it... you're using the wrong URL.

    http://www.lfgss.com GET /api/v1/files/677fd6380f7e4b1f9428035dfa7e3dbcb227cfbd.png HTTP/1.1

    body_bytes_sent	19
    filename	/var/log/nginx/https.wildcard.microcosm.app.access.log
    geoip_country_code	AU
    host	http://www.lfgss.com
    http_user_agent	Dart/3.4 (dart:io)
    job	lb.microcosm.cc
    msec	1717940166.718
    remote_addr	163.53.144.29
    request	GET /api/v1/files/677fd6380f7e4b1f9428035dfa7e3dbcb227cfbd.png HTTP/1.1
    request_length	372
    request_method	GET
    request_time	0.001
    request_uri	/api/v1/files/677fd6380f7e4b1f9428035dfa7e3dbcb227cfbd.png
    server_protocol	HTTP/1.1
    service_name	lb.microcosm.cc
    ssl_cipher	TLSv1.3/TLS_AES_256_GCM_SHA384
    ssl_protocol	TLSv1.3/TLSv1.3
    status	404
    time_local	2024-06-09T13:36:06+00:00
    

    ignore the http:// prefix in the host name... that isn't actually there, but the Markdown "I'm going to guess this is a link" got involved when I posted it.

    it shouldn't be https://www.lfgss.com/api/v1/files/677fd6380f7e4b1f9428035dfa7e3dbcb227cfbd.png

    it should be https://lfgss.microcosm.app/api/v1/files/677fd6380f7e4b1f9428035dfa7e3dbcb227cfbd.png

    I can reproduce this... in so far as, when I use the app I get 404s and I see them in the logs.

    I've put a fix into the nginx caching to ensure the $host was in the cache key, as this avoids 404s generated by the app poisoning the cache for others.

    In the server block

            location /api/v1/files {
                    proxy_pass            http://microcosm;
                    proxy_read_timeout    90;
                    proxy_cache_key       "$request_method $scheme://$host$request_uri";                                                                     
                    proxy_ignore_headers  Set-Cookie;
                    proxy_hide_header     Set-Cookie;
                    proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
                    add_header            X-Cache-Status $upstream_cache_status;
                    proxy_cache_valid     any 1y;
                    proxy_cache           FILES;
                    proxy_cache_lock      on;
            }
    

    the $request_method $scheme://$host are all new to that.

    ignore the proxy_pass http://microcosm; there, as in nginx that's just talking about a backend proxy not a request URL.

About

Avatar for Velocio @Velocio started