We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
nopCommerce version: the latest
Steps to reproduce the problem: I added below codes to get the RemoteIpAddress. httpContext.Connection.RemoteIpAddress?.MapToIPv4().ToString();
httpContext.Connection.RemoteIpAddress?.MapToIPv4().ToString();
but,the RemoteIpAddress was always 127.0.0.1.
I followed the advice from : aspnet/IISIntegration#140 https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-7.0
I modified code as below :
public static void UseNopProxy(this IApplicationBuilder application) { var appSettings = EngineContext.Current.Resolve<AppSettings>(); if (appSettings.Get<HostingConfig>().UseProxy) { var options = new ForwardedHeadersOptions { //ForwardedHeaders = ForwardedHeaders.All, ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
Then, I can get the accurate RemoteIpAddress now.
The text was updated successfully, but these errors were encountered:
Couldn't reproduce. Closed #6486
Sorry, something went wrong.
exileDev
No branches or pull requests
nopCommerce version:
the latest
Steps to reproduce the problem:
I added below codes to get the RemoteIpAddress.
httpContext.Connection.RemoteIpAddress?.MapToIPv4().ToString();
but,the RemoteIpAddress was always 127.0.0.1.
I followed the advice from :
aspnet/IISIntegration#140
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-7.0
I modified code as below :
Then, I can get the accurate RemoteIpAddress now.
The text was updated successfully, but these errors were encountered: