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

asp.net RC2 RemoteIpAddress always "127.0.0.1" on Azure #1456

Closed
joaomello-zz opened this issue May 17, 2016 · 4 comments
Closed

asp.net RC2 RemoteIpAddress always "127.0.0.1" on Azure #1456

joaomello-zz opened this issue May 17, 2016 · 4 comments

Comments

@joaomello-zz
Copy link

joaomello-zz commented May 17, 2016

I had this code on the controller:

public IActionResult Ip()
{
  return Ok(new { Ip = HttpContext.Connection.RemoteIpAddress?.ToString() });
}

but azure always returning:
{"Ip":"127.0.0.1"}

I am using with .net 4.6. I have add:

services.Configure<ForwardedHeadersOptions>(options =>
{
  options.ForwardedHeaders = Microsoft.AspNetCore.HttpOverrides.ForwardedHeaders.All;
});

Like @davidfowl said to me, but continues same ipaddress. Any idea?

@Tratcher
Copy link
Member

This looks like the same issue as aspnet/IISIntegration#140. Try Microsoft.AspNetCore.HttpOverrides.ForwardedHeaders.XForwardedFor;

@joaomello-zz
Copy link
Author

You are right @Tratcher, works now. But I used Microsoft.AspNetCore.HttpOverrides.ForwardedHeaders.All shouldn't be worked with it too?

@Tratcher
Copy link
Member

It should, but it's broken on Azure right now.

@joaomello-zz
Copy link
Author

Thanks @Tratcher!

jkotalik pushed a commit that referenced this issue Nov 1, 2018
Fixup the paths to files to be signed.
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants