Created
June 22, 2020 21:45
-
-
Save Kikimora/1ad7e212e1fc5f5ce4187ae460f5a32f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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