this post was submitted on 16 Jul 2021
5 points (100.0% liked)

Lemmy

12729 readers
6 users here now

Everything about Lemmy; bugs, gripes, praises, and advocacy.

For discussion about the lemmy.ml instance, go to [email protected].

founded 4 years ago
MODERATORS
 

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\d+.\d+.\d+). $ip.0; ~(?P[^:]+:[^:]+): $ip::; 0.0.0.0 $remote_addr; ::1 $remote_addr; default 0.0.0.0; }

Please help. Thanks.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 4 points 3 years ago (10 children)

Open up an issue on the github and post your docker compose file and lemmy.hjson.

[–] [email protected] 4 points 3 years ago (9 children)

I dont really think that github issues are the best place for that, i'd prefer to use them only for bugs or feature requests.

@[email protected] This seems more like a problem with your docker-compose.yml, did you make any changes to it? Try docker-compose logs.

[–] [email protected] 1 points 3 years ago (2 children)

Thanks

i changed postgres user and password; changed lemmy external host to mydomain.com; iframely memory limit changed to 500m

[–] [email protected] 1 points 3 years ago (1 children)

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.

my previous post

[–] [email protected] 1 points 3 years ago

No, leave that as it is.

load more comments (6 replies)
load more comments (6 replies)