I followed the docker installation instructions and added the certificate successfully but I get this status:

400 Bad Request | nginx

host nginx error logs:

2023/06/11 12:12:45 [debug] 10161#10161: *16 http upstream process header
2023/06/11 12:12:45 [error] 10161#10161: *16 connect() failed (111: Connection refused) while connecting to upstream, client: 198.199.109.53, server: mydomain.tld, request: "GET /version HTTP/1.1", upstream: "http://127.0.0.1:82/version", host: "xxx.xxx.xx.xxx"
2023/06/11 12:12:45 [debug] 10161#10161: *16 http next upstream, 2
2023/06/11 12:12:45 [debug] 10161#10161: *16 free rr peer 2 4
2023/06/11 12:12:45 [warn] 10161#10161: *16 upstream server temporarily disabled while connecting to upstream, client: 198.199.109.53, server: mydomain.tld, request: "GET /version HTTP/1.1", upstream: "http://127.0.0.1:82/version", host: "xxx.xxx.xx.xxx"

I replaced my host IP and domain for privacy

Please see my comments below for more info. I tried putting all text here in the body but it won’t let me post.

EDIT: It is now fixed! What I did is replace the following line in my host nginx:

location / {
         proxy_pass http://localhost:82;
         proxy_set_header Host $host;  <---- replace this
         include proxy_params;
    }

With this:

location / {
         proxy_pass http://127.0.0.1:82;
         proxy_set_header Connection "keep-alive, Upgrade";
         proxy_set_header Upgrade websocket;
         include proxy_params;
    }

And thanks to @frozen@lemmy.frozeninferno.xyz who pointed me in the right direction to allow search to other instances:

networks:
  # communication to web and clients
  lemmyexternalproxy:
  lemmybridge:  <<----- added this
  # communication between lemmy services
  lemmyinternal:
    driver: bridge
    internal: true

services:
  proxy:
    image: nginx:1-alpine
    networks:
      - lemmyinternal
      - lemmyexternalproxy
      - lemmybridge  <<----- added this

  lemmy:
    image: dessalines/lemmy:0.17.3
    hostname: lemmy
    networks:
      - lemmyinternal
      - lemmybridge <<----- added this
 
  • ThorfinnOfThors@lemmy.mlOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Host lemmy conf

    spoiler
    #worker_processes  1;
    
    #error_log  logs/error.log;
    #error_log  logs/error.log  notice;
    #error_log  logs/error.log  info;
    
    #pid        logs/nginx.pid;
    
    
    server {
        listen 443 ssl; # managed by Certbot
        server_name  mydomain.tld www.mydomain.tld;
    
        #charset koi8-r;
    
        #access_log  logs/host.access.log  main;
    
        #location / {
        #    root   html;
        #    index  index.html index.htm;
        #}
    
        #error_page  404              /404.html;
    
        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    
        ssl_certificate /etc/letsencrypt/live/mydomain.tld/fullchain.pem; # managed by Certbot
        ssl_certificate_key /etc/letsencrypt/live/mydomain.tld/privkey.pem; # managed by Certbot
        include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
    
        location / {
             proxy_pass http://localhost:82;
             proxy_set_header Host $host;
             include proxy_params;
        }
    }
    
    
    server {
        listen       80;
        server_name  mydomain.tld www.mydomain.tld;
    
        if ($host = www.mydomain.tld) {
            return 301 https://$host$request_uri;
        } # managed by Certbot
    
    
        if ($host = mydomain.tld) {
            return 301 https://$host$request_uri;
        } # managed by Certbot
    
        return 404; # managed by Certbot
    }