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

NGINX (or general reverse proxy) compatibility #25

Open
ckcr4lyf opened this issue Feb 7, 2023 · 1 comment
Open

NGINX (or general reverse proxy) compatibility #25

ckcr4lyf opened this issue Feb 7, 2023 · 1 comment

Comments

@ckcr4lyf
Copy link
Owner

ckcr4lyf commented Feb 7, 2023

Currently we take the IP address from source directly

It would be nice if we can put it behind NGINX, and get the IP via header such as X-Forwarded-For.

This should be a configurable property, since in cases where we do not have a reverse-proxy we don't want to "trust" this header as a source of truth for the IP.

@ckcr4lyf
Copy link
Owner Author

ckcr4lyf commented Feb 7, 2023

kiryuu/src/main.rs

Lines 53 to 61 in 156bded

let query = req.query_string();
let conn_info = req.connection_info();
let user_ip = match conn_info.peer_addr() {
Some(ip) => ip,
None => {
return HttpResponse::build(StatusCode::BAD_REQUEST).body("Missing IP");
}
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant