이것은 Nginx의 첫 번째 아기 단계이므로 도움이 될 것입니다. 하위 경로에서 Asp.net 핵심 사이트를 찾는 방법
나는 두 개의 용기로 구성된 작은 고정 표시기-작성 응용 프로그램이 있습니다 의 nginx 업로드를Nginx에 우리의 인트라넷과 같이 연결할 수 있도록 Nginx의 포트 (80)는 호스트 시스템에 노출되어 www.mytest 등
는 현재, 나는 이것을 달성 할 수없는 오전 www.mytest.net/upload/, 모든 URL : .NET 나는 지금 asp.net 코어 사이트처럼, 그 주소의 하위 경로에 "업로드"노출 될 수 내가 업로드 경로로 이동하려고 NGINX, asp.net 코어 또는 모두를 구성 해야하는지 확신이없는 경우 업로드시 작동하지 않습니다 diff 격렬히 Nginx.conf에서
현재 설정은 :
location/{
proxy_pass http://upload:80;
# The default minimum configuration required for ASP.NET Core
# See https://docs.asp.net/en/latest/publishing/linuxproduction.html?highlight=nginx#configure-a-reverse-proxy-server
proxy_cache_bypass $http_upgrade;
# Turn off changing the URL's in headers like the 'Location' HTTP header.
proxy_redirect off;
# Forwards the Host HTTP header.
proxy_set_header Host $host;
# The Kestrel web server we are forwarding requests to only speaks HTTP 1.1.
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
# Adds the 'Connection: keep-alive' HTTP header.
proxy_set_header Connection keep-alive;
}
}
내가 말했듯이, "/"에 작동하지만, 내가 사용하는 경우 더 이상 인해 작동하지 않습니다 업로드 사이트에서 간단한 양식을 "업로드" URL 불일치.
HttpContext.Request.PathBase와 UsePathBase라는 새 확장 프로그램을 읽어보십시오. 이렇게하면 경로가 엉망이되지 않도록 앱 루트 URL을 분리 할 수 있습니다. – Tratcher
@Tratcher 대단히 감사합니다! 나는 그렇게 할 것이다. 친절하게 대답 해 주시겠습니까? –