Trying to test lemmy on my vps ubuntu 20.04. Followed the docs but cant get to configured correctly.

root@*******:/lemmy# docker-compose up -d WARNING: The Hn variable is not set. Defaulting to a blank string. WARNING: The n4WfWc variable is not set. Defaulting to a blank string. Starting lemmy_iframely_1 … done Starting lemmy_pictrs_1 … done Starting lemmy_postgres_1 … done Starting lemmy_lemmy_1 … done Starting lemmy_lemmy-ui_1 … done

i think it has to do with my nginx lemmy.conf. I have replaced proxy pass 0.0.0.0 with my vps ip (is this correct?) but can’t get to working. Installed with letsencrypt and using cloudflare.

frontend

location / {
  # The default ports:
  # lemmy_ui_port: 1235
  # lemmy_port: 8536

  set $proxpass "http://0.0.0.0:1235";
  if ($http_accept = "application/activity+json") {
    set $proxpass "http://0.0.0.0:8536";
  }
  if ($http_accept = "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") {
    set $proxpass "http://0.0.0.0:8536";
  }
  if ($request_method = POST) {
    set $proxpass "http://0.0.0.0:8536";
  }
  proxy_pass $proxpass;

  rewrite ^(.+)/+$ $1 permanent;

  # Send actual client IP upstream
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header Host $host;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

# backend
location ~ ^/(api|pictrs|feeds|nodeinfo|.well-known) {
  proxy_pass http://0.0.0.0:8536;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "upgrade";

  # Rate limit
  limit_req zone=lemmy_ratelimit burst=30 nodelay;

  # Add IP forwarding headers
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header Host $host;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}


# Redirect pictshare images to pictrs
location ~ /pictshare/(.*)$ {
  return 301 /pictrs/image/$1;
}

location /iframely/ {
  proxy_pass http://0.0.0.0:8061/;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header Host $host;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

}

Anonymize IP addresses

https://www.supertechcrew.com/anonymizing-logs-nginx-apache/

map $remote_addr $remote_addr_anon { ~(?P<ip>\d+.\d+.\d+). $ip.0; ~(?P<ip>[:]+:[:]+): $ip::; 0.0.0.0 $remote_addr; ::1 $remote_addr; default 0.0.0.0; }

Please help. Thanks.

  • 9toitoi5OP
    link
    fedilink
    arrow-up
    1
    ·
    3 years ago

    docker-compose logs : seemed to be postgres?? i also replaced postgres username and password in lemmy.hjson

    thread ‘main’ panicked at ‘Error connecting to postgres://root:mychangedpassword@postgres:5432/lemmy’, src/main.rs:43:25

    • nutomicMA
      link
      fedilink
      arrow-up
      2
      ·
      3 years ago

      Seems like your passwork is wrong. Did you change it after first start? In that case its easiest to stop everything (docker-compose down), delete the volumes folder, and start again. You can also start using docker-compose up (without -d) to see the logs from startup.

      • 9toitoi5OP
        link
        fedilink
        arrow-up
        1
        ·
        3 years ago

        thanks connected to postgres but still problems…we need lemmy installation docs for newbies.

        • nutomicMA
          link
          fedilink
          arrow-up
          1
          ·
          3 years ago

          What specifically do you think is missing from the docs? I suggest you try with Ansible, that configures everything automatically so you dont have to touch config files on the server.