Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] latest lnbits v0.12.5 » lnbits-reverse-proxy.conf doesn't allow topup and restart #1430

Open
editwentyone opened this issue May 13, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@editwentyone
Copy link

inspecting with browser, console:

Request URL:
https://192.168.1.10:4003/admin/api/v1/restart/
Request Method:
GET
Status Code:
307 Temporary Redirect
Referrer Policy:
strict-origin-when-cross-origin

same goes for topup function

Request URL:
https://192.168.1.10:4003/admin/api/v1/topup/
Request Method:
PUT
Status Code:
307 Temporary Redirect
Referrer Policy:
strict-origin-when-cross-origin

my research tells me it has something to do with nginx reverse proxy, I already reinstalled nginx and reused the default conf from your guide, but I have no luck getting LNbits to work, everything lese is working with the reverse proxy setup.

if I open up LNbits :5000 port and use it directly through this port, I can topup and restart and control LNbits without issues.

any help is very much appreciated

@editwentyone editwentyone added the bug Something isn't working label May 13, 2024
@editwentyone editwentyone changed the title [BUG] lnbits-reverse-proxy.conf doesn't allow topup and restart [BUG] latest lnbits v0.12.5 » lnbits-reverse-proxy.conf doesn't allow topup and restart May 13, 2024
@editwentyone
Copy link
Author

xhr, strict-origin-when-cross-origin, 307 Temporary Redirect, (blocked:mixed-content)

bundle.min.js?v=1715611579:42

https://192.168.1.10:4003/admin/api/v1/topup/

@editwentyone
Copy link
Author

editwentyone commented May 14, 2024

finally after days of "WTF is NGINX doing" » I "fixed it", had to remove lnbits.conf from stream-enabled
and created lnbits.conf inside sites-enabled (ln -s from sites-available) with the following content

would be nice if someone could double check my stuff, total noob here

server {
    server_name lnbits.org;

    location / {
        proxy_pass http://127.0.0.1:5000;

    # Simple requests
    if ($request_method ~* "(GET|POST)") {
      add_header "Access-Control-Allow-Origin"  *;
    }

    # Preflighted requests
    if ($request_method = OPTIONS ) {
      add_header "Access-Control-Allow-Origin"  *;
      add_header "Access-Control-Allow-Methods" "GET, POST, OPTIONS, HEAD";
      add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Requested-With, Content-Type, Accept";
      return 200;
    }

}

    listen [::]:4003 ssl;
    listen 4003 ssl;
    ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
    ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
    ssl_session_timeout 4h;
    ssl_protocols TLSv1.3;
    ssl_prefer_server_ciphers on;
}

@editwentyone
Copy link
Author

to connect from outside this is maybe also a nice addon: #1433

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant