this post was submitted on 28 Oct 2025
3 points (100.0% liked)

Lemmy Support

4981 readers
2 users here now

Support / questions about Lemmy.

Matrix Space: #lemmy-space

founded 6 years ago
MODERATORS
 

Hello everyone,

I'm encountering an issue when trying to post from my Mastodon instance to my Lemmy instance. Both are running on separate virtual servers managed by Proxmox, and they communicate through a single reverse proxy.

Here is the relevant error log from the Lemmy web container:

2025-10-28T22:06:10.751716Z  WARN Error encountered while processing the incoming HTTP request: lemmy_server::root_span_builder: Unknown: URL failed verification: Localhost is only allowed in debug mode
2025-10-28T22:06:10.751717Z  TRACE tokio_postgres::connection: poll_flush: flushed    
2025-10-28T22:06:10.751766Z  INFO actix_web::middleware::logger: 192.168.100.12 'POST /inbox HTTP/1.1' 400 96 '-' 'Mastodon/4.4.8 (http.rb/5.3.1; +https://rollenspiel.social/)' 0.001290  

The key warning is:

URL failed verification: Localhost is only allowed in debug mode

It seems Lemmy is rejecting the request because it detects a localhost URL somewhere in the request or configuration, which is only permitted in debug mode.

Has anyone seen this error before or knows how to configure Lemmy or the reverse proxy to avoid this "localhost" URL verification failure? Any pointers on what to check or how to debug this further would be appreciated.

Thanks in advance!

top 3 comments
sorted by: hot top controversial new old
[–] pReya@discuss.tchncs.de 1 points 1 week ago

Where does the "Localhost" come from? Did you enter this somewhere? trying to post from my Mastodon instance to my Lemmy instance How are you doing/triggering this?

[–] Tealk@rollenspiel.forum 1 points 1 week ago

I've tried a few things now, hardcoded proxy headers:

  proxy_set_header X-Real-IP $custom_real_ip;
  proxy_set_header X-Forwarded-For $custom_forwarded_for;

setting the IP for the domain in the container:

    extra_hosts:
      - "rollenspiel.forum:142.132.206.141"

setting the DNS server in the container:

    dns:
      - 8.8.8.8

it doesn't change the error message, I don't know what Lemmy checks to determine that it's a local IP, because all standard tools show me the public IP for rollenspiel.forum.

[–] Tealk@rollenspiel.forum 1 points 1 week ago

OK, I don't understand what excluding local addresses has to do with security. It's not that unusual to route within the network.

https://github.com/LemmyNet/activitypub-federation-rust/blob/0.5.10/src/config.rs#L207