question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Login not possible behind reverse proxy

See original GitHub issue

Can you please give an example on how to use this application behind a reverse proxy? I’ve tried a lot of combinations, and none seem to work, I’m currently using this config:

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

        proxy_http_version 1.1;
        proxy_set_header Host $host:$server_port;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

If I don’t use the X-Forwarded-For header, the webfront always logins automatically as CONSOLE, otherwise I can’t seem to login. It does reject invalid passwords, and seems to accept valid ones, but the menubar still shows the user as unauthenticated…

Any help would be appreciated.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
RaidMaxcommented, Jun 5, 2021

It does work, but there is a special rule setup to give root access to local host IP https://github.com/RaidMax/IW4M-Admin/blob/release/pre/SharedLibraryCore/BaseController.cs#L82

This is to make it easy to administrate from the same machine IW4MAdmin is running on. There is also protection against accidentally proxying the console user on localhost which checks the X-Fowarded-For header.

Make sure to use either a different loopback address (eg 127.0.0.2), the internal (NAT) address or WAN address of the machine and you should be able to log in properly.

1reaction
mjkzycommented, Feb 3, 2022

Late bump to this issue, but came across this last night. The fix I found was using proxy_bind in your headers. Also, making sure X-Forwarded-For IS DEFINED or people will have root (console) access.

Here’s my configuration for nginx that works with IW4MAdmin: image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nginx reverse proxy to server with login not working as ...
I have two servers behind an nginx reverse proxy. I am being forwarded correctly to the sites, but one of the sites has...
Read more >
Unable to login via reverse proxy : r/portainer
This is most likely a security feautre? Is there a way to get around this? (And no, I have no intentions to expose...
Read more >
login not possible when behind a reverse proxy with http ...
Having the same issue but with an Apache reverse proxy with the basic auth. Couldn't figure out why it wouldn't let me log...
Read more >
Unable to login with Reverse Proxy - ℹ️ Support
The issue you are facing: I have a Nginx reverse proxy running on another virtual server. Nginx 1.17.7, Ubuntu 18.04, and Certbot/LetsEncrypt ...
Read more >
No WP login behind a Reverse Proxy. Just redirect loop.
So login is OK direct. But login FAILS for reverse-proxy. @robscott You sounded @ that previous post like you had some clues how...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found