Compare commits
No commits in common. "6c8fdf875f24552b1e4d5db948a92205e60a84f1" and "bacb791ba9a3954855162523a79ef521cb0c5083" have entirely different histories.
6c8fdf875f
...
bacb791ba9
@ -4,19 +4,10 @@ using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.Collections;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
var Configuration = builder.Configuration;
|
||||
|
||||
builder.Services.Configure<ForwardedHeadersOptions>(options =>
|
||||
{
|
||||
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||
|
||||
options.KnownNetworks.Clear();
|
||||
options.KnownProxies.Clear();
|
||||
});
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddRazorPages();
|
||||
builder.Services.AddControllers();
|
||||
@ -40,7 +31,12 @@ builder.Services.AddAuthentication(options => {
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseForwardedHeaders();
|
||||
app.UseForwardedHeaders(new ForwardedHeadersOptions
|
||||
{
|
||||
RequireHeaderSymmetry = false,
|
||||
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
|
||||
});
|
||||
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (!app.Environment.IsDevelopment())
|
||||
|
@ -27,7 +27,7 @@ http {
|
||||
|
||||
#gzip on;
|
||||
|
||||
# include /etc/nginx/conf.d/*.conf;
|
||||
# include /etc/nginx/conf.d/*.conf;
|
||||
|
||||
server {
|
||||
listen 9000;
|
||||
@ -58,14 +58,10 @@ http {
|
||||
}
|
||||
|
||||
location / {
|
||||
# Do preserve this
|
||||
proxy_set_header Host $http_host;
|
||||
# again dont overwrite this
|
||||
#proxy_set_header X-Real-IP $remote_addr;
|
||||
# this just seems to append another ip ie <host>, <proxy>
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
# Preserve the scheme as https if behind another proxy
|
||||
#proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
proxy_connect_timeout 300;
|
||||
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
|
||||
|
Loading…
x
Reference in New Issue
Block a user