Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net core 如何运行ASP.Net核心API+;Linux环境下的Websocket项目?_Asp.net Core_Centos_Httpd.conf - Fatal编程技术网

Asp.net core 如何运行ASP.Net核心API+;Linux环境下的Websocket项目?

Asp.net core 如何运行ASP.Net核心API+;Linux环境下的Websocket项目?,asp.net-core,centos,httpd.conf,Asp.net Core,Centos,Httpd.conf,我的ASP Net核心API也在同一端口5000上运行Websocket。我在开发模式下工作正常,但如何在Linux(CentOS 7?)上运行它 我尝试了以下方法: <IfModule mod_ssl.c> <VirtualHost *:443> ServerName apiws.mydomain.com ServerAlias apiws.mydomain.com DocumentRoot /var/www/html

我的ASP Net核心API也在同一端口5000上运行Websocket。我在开发模式下工作正常,但如何在Linux(CentOS 7?)上运行它

我尝试了以下方法:

<IfModule mod_ssl.c>
    <VirtualHost *:443>
       ServerName apiws.mydomain.com
       ServerAlias apiws.mydomain.com
       DocumentRoot /var/www/html
       ErrorLog /var/log/httpd/error.log
       CustomLog /var/log/httpd/requests.log combined

       <Location /api/>
          ProxyPass http://localhost:5000/
          ProxyPassReverse http://localhost:5000/
          ProxyPass ws://localhost:5000/
          Require all granted
       </Location>

      SSLCertificateFile /etc/letsencrypt/live/apiws.mydomain.com/fullchain.pem
      SSLCertificateKeyFile /etc/letsencrypt/live/apiws.mydomain.com/privkey.pem
      Include /etc/letsencrypt/options-ssl-apache.conf
 </VirtualHost>

ServerName apiws.mydomain.com
ServerAlias apiws.mydomain.com
DocumentRoot/var/www/html
ErrorLog/var/log/httpd/error.log
CustomLog/var/log/httpd/requests.log组合
ProxyPasshttp://localhost:5000/
ProxyPassReversehttp://localhost:5000/
ProxyPass ws://localhost:5000/
要求所有授权
SSLCertificateFile/etc/letsencrypt/live/apiws.mydomain.com/fullchain.pem
SSLCertificateKeyFile/etc/letsencrypt/live/apiws.mydomain.com/privkey.pem
Include/etc/letsencrypt/options-ssl-apache.conf
如果我使用ProxyPassws://localhost:5000/。。WebSocket运行正常,但我的API引发内部服务器错误。。但是如果我注释ws://localhost:5000/WebSocket将不会运行,但我的API工作正常

如何应对