如何将Apache反向代理转换为asp net core api和angular 6应用程序

问题描述 投票:0回答:1

我有一个aspnet core apilocalhost:8080(红隼)上运行。一切都在localhost:80(apache反向代理)上完美运行,可以从互联网上访问www.example.com

我想在这个端口locahost:80www.example.com)上部署角客户端,并且仍然能够访问www.api.example.comwww.example.com/api上的api。如何在我的.conf文件中修改我的虚拟主机?

 <VirtualHost *:*>
     RequestHeader set "X-Forwarded-Proto" http
     RequestHeader set "X-Forwarded-Proto" https
 </VirtualHost>

 <VirtualHost *:80>
     ProxyPreserveHost On
     ProxyPass / http://127.0.0.1:8080/
     ProxyPassReverse / http://127.0.0.1:8080/
     ServerName www.example.com
     ServerAlias *.example.com
     ErrorLog /var/log/httpd/core_log
     CustomLog /var/log/httpd/core_access_log common
 </VirtualHost>
angular apache reverse-proxy virtualhost
1个回答
0
投票

尝试:

ProxyPass /api/ http://127.0.0.1:8080/api/
ProxyPassReverse /api/ http://127.0.0.1:8080/api/
© www.soinside.com 2019 - 2024. All rights reserved.