简体   繁体   English

使用 Plesk 为 Linux 部署 ASP.Net Core

[英]Deploy ASP.Net Core with Plesk for Linux

Following is my server environment以下是我的服务器环境

  • Server: VPS服务器:VPS
  • Host: AWS EC2主机:AWS EC2
  • OS: CentOS Linux 8.3.2011操作系统:CentOS Linux 8.3.2011
  • Plesk: Plesk Obsidian 18.0.34 Plesk:Plesk 黑曜石 18.0.34
  • .Net Version: .Net Core 3.0 (Installed manually from linux CLI) .Net 版本:.Net Core 3.0(从 linux CLI 手动安装)

What I am look for我在寻找什么

I am trying to deploy ASP.Net Core 3.0 api project to CentOS 8 server.我正在尝试将 ASP.Net Core 3.0 api 项目部署到 CentOS 8 服务器。 Is there a way to use plesk to deploy this?有没有办法使用 plesk 来部署它? May be by providing additional settings under "Apache & nginx Settings" (or any other way)?可能是通过在“Apache & nginx 设置”下提供其他设置(或任何其他方式)?

Edit编辑

Tried following this article - Error using ASP.NET Core in Ubuntu with Plesk尝试按照这篇文章 - 在 Plesk 的 Ubuntu 中使用 ASP.NET 内核时出错

  • Have turned off - Reverse Proxy Server (nginx) from plesk已关闭 - 来自 plesk 的反向代理服务器 (nginx)
  • Added following configuration to "Additional Apache directive" under Apache & nginx Settings在 Apache 和 nginx 设置下的“附加 Apache 指令”中添加了以下配置

. .

RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}

SSLProxyEngine On
SSLProxyVerify none

ProxyPreserveHost On

ProxyPass / https://127.0.0.1:5001/
ProxyPassReverse / https://127.0.0.1:5001/

But getting different error.但得到不同的错误。

AH00898: Error during SSL Handshake with remote server returned by /

Any help would be highly appreciated.任何帮助将不胜感激。

Many Thanks & Regards非常感谢和问候

Finally after some detailed debugging and understanding how the flow works between Plesk, Apache, NginX and ASP.Net Core, managed to get it working.最后经过一些详细的调试和了解 Plesk、Apache、NginX 和 ASP.Net Core 之间的流程是如何工作的,设法让它工作。 Added following configuration to "Additional Apache directive" under Apache & nginx Setting.在 Apache & nginx 设置下的“附加 Apache 指令”中添加了以下配置。

RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}

Protocols             h2 http/1.1

SSLEngine             on
SSLProtocol           all -SSLv3 -TLSv1 -TLSv1.1
SSLHonorCipherOrder   off
SSLCompression        off
SSLSessionTickets     on
SSLUseStapling        off

SSLProxyEngine On
SSLProxyVerify none

ProxyPreserveHost On

ProxyPass             / http://127.0.0.1:5000/
ProxyPassReverse      / http://127.0.0.1:5000/

Key thing to notice is that Proxy is redirecting to http and not https.需要注意的关键是 Proxy 正在重定向到 http 而不是 https。 But that is just internal in AWS server and user end is already protected by SSL configured through Apache.但这只是 AWS 服务器内部的,用户端已经受到通过 Apache 配置的 SSL 的保护。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM