Hiya,

I’ve mostly successfully installed lemmy from source, but I’ve got one problem. When going to my lemmy instance /setup to create an admin account, when pressing the button, I get a message saying unexpect doctype html invalid json. I don’t know what I’m doing wrong, I followed the installing from source guide, replacing the ui checkout from git with 0.18.0 rather than 0.16.7 as mentioned in the guide. It seems to me that something is pointing to the ui, rather than the backend, but I cannot see where that might be. Anyone experienced this before? Any help?

Thanks!

-Michael.

  • DocTator
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    I had this problem… had to kind of frankenstein a conf file together and just kind of go error by error until the thing started working.

    • MWTabOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Can you provide more details? With this specific error I really have no idea what is wrong, my best guess is that the nginx config is incomplete, since it sends everything to the ui and maybe there’s a path, like /api or something that should go to the backend instead? I just don’t know what on earth that path would be. If you’re using nginx mind sending me a redacted copy of your config for nginx? That might allow me to determine if something is wrong with mine… Thanks!

      -Michael.

      • DocTator
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        ugh, this is getting frustrating. I ran through the installation again just to end up where I ended up in the first place. Here’s my nginx configuration as lemmy.conf … maybe you can see something I don’t…

        upstream lemmy { server lemmydocker.genesis-radio.net:8536; }

        upstream lemmy-ui { server lemmydocker.genesis-radio.net:1234; }

        server { listen 1236; listen 8536; server_name lemmydocker.genesis-radio.net; server_tokens off;

        gzip on;
        gzip_types text/css application/javascript image/svg+xml;
        gzip_vary on;
        
        client_max_body_size 20M;
        
        add_header X-Frame-Options SAMEORIGIN;
        add_header X-Content-Type-Options nosniff;
        add_header X-XSS-Protection "1; mode=block";
        
        location / {
            set $proxypass "http://lemmy-ui";
        
            if ($http_accept = "application/activity+json") {
                set $proxypass "http://lemmy";
            }
            if ($http_accept = "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") {
                set $proxypass "http://lemmy";
            }
            if ($request_method = POST) {
                set $proxypass "http://lemmy";
            }
        
            proxy_pass $proxypass;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
        
        location ~ ^/(api|pictrs|feeds|nodeinfo|.well-known) {
            proxy_pass http://lemmy;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
        

        } _`

        I don’t care if people see urls and crap as its a test server and im gonna break it down once I get it fully working anyway. Just doing this to clear up documentation issues. lol

      • DocTator
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        going to redo it with some different settings and see if it makes any difference, I’ll share once I’ve completed.

  • hawkwind@lemmy.management
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    I think there has been some issues with the docs and maybe the config files in the repo for nginx / reverse proxy. It’s definitely a key part that some paths go to the UI and some to the backend. It sounds like your sending a request meant for the ui to the backend.

    • MWTabOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      Where can I find a (hopefully) working nginx config? I got mine from wherever the doc told me to, which considering it was recommending 0.16.7 for the ui might be out of date.

      • MWTabOP
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        Looks like the latest from the ansible repo is basically the same as the one I have, minus replacing the {{variable name}} things. So perhaps I have the environment variables wrong somehow? Here are the relevant environment variables:

        Environment=LEMMY_UI_LEMMY_INTERNAL_HOST=127.0.0.1:8536

        Environment=LEMMY_UI_HOST=127.0.0.1:1234

        -Michael.