• 𝒍𝒆𝒎𝒂𝒏𝒏@lemmy.one
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    You could try this

    this config snippet is assuming thet you’ve already got the TLS cert/pem file for lemmy.world elsewhere in your nginx.config

    http {
      server {
        listen 80;
        listen 443 ssl;
        server_name lemmy.world;
    
        if ($scheme = "http") {
            return 307 https://$host$request_uri;
        }
    
        location / {
            proxy_pass http://lemmy-ui:1234;
            proxy_set_header Host $host;
        }
    }
    

    If you get redirected to lemmy.world:1234, then add absolute_redirect off; in the ‘server’ block

    Last thing - 307 is a temporary redirect, you might to change it to a permanent one once you’ve confirmed it’s working as intended