Skip to content

Instantly share code, notes, and snippets.

@Kikimora
Created June 22, 2020 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kikimora/1ad7e212e1fc5f5ce4187ae460f5a32f to your computer and use it in GitHub Desktop.
Save Kikimora/1ad7e212e1fc5f5ce4187ae460f5a32f to your computer and use it in GitHub Desktop.
#PathBaseMiddleware не нужен!
location /bots/ {
proxy_http_version 1.1;
proxy_set_header X-Original-URI $request_uri;
#чтобы nginx стартовал даже если хост bots недоступно
set $upstream_bots bots;
# $request_uri; надо добавить чтобы nginx передавал path, даже если proxy_pass $variable.
proxy_pass http://$upstream_bots$request_uri;
}
//В .NET конфигурируем BasePath, вот так
public virtual void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
var pathBase = _configuration.GetValue<string>("ASP.NET:PathBase");
if (!string.IsNullOrEmpty(pathBase))
{
app.UsePathBase(pathBase);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment