问题描述
我正在尝试在 XAMPP 中设置反向代理服务器,以避免在我尝试访问在不同端口上运行的 API 时发生的 CORS 错误。 我已经对我的文件进行了这些更改。
API 的详细信息是:
- host=http://127.0.0.1
- 端口=8002
httpd-vhosts.conf
<VirtualHost *:8002>
ProxyRequests On
<Proxy>
Order deny,allow
Allow from all
</Proxy>
Header set Access-Control-Allow-Origin "*"
</VirtualHost>
httpd-proxy.conf
<IfModule proxy_module>
<IfModule proxy_http_module>
#
# Reverse Proxy
#
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
</IfModule>
</IfModule>
httpd.conf
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_rewrite.so
当我启动我的 Apache 服务器时,它没有启动并抛出一个错误:
15:00:12 [Apache] This may be due to a blocked port,missing dependencies,15:00:12 [Apache] improper privileges,a crash,or a shutdown by another method.
15:00:12 [Apache] Press the Logs button to view error logs and check
15:00:12 [Apache] the Windows Event Viewer for more clues
15:00:12 [Apache] If you need more help,copy and post this
15:00:12 [Apache] entire log window on the forums
我应该继续使用 XAMPP 还是使用 Nginx 来设置反向代理?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)