我正在使用服务器
版本:Apache / 2.4.6(CentOS)
我已经在上面托管了具有自己的路由系统的react应用
在apache config中,我想将/api
呼叫路由到相同的另一个端口
服务器,但是每当我像https://servername.com/api
这样调用api时,它都会路由我来响应应用程序
我的Apache配置如下
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]
</Directory>
LoadModule proxy_http_module /usr/lib64/httpd/modules/mod_proxy_http.so
NameVirtualHost *:80
<VirtualHost *:443>
ServerName dummy.com
---Proxy *---
Order deny,allow
Allow from all
---/Proxy---
SSLProtocol TLSv1.2
SSLCompression Off
SSLEngine On
SSLProxyEngine On
SSLHonorCipherOrder on
SSLCipherSuite Something+Something+Something+Something+Something+Something+Something+Something+Something+Something+Something+Something+Something+Something
SSLCertificateFile /etc/httpd/ssl-cert/dummy.com.crt
SSLCertificateKeyFile /etc/httpd/ssl-cert/dummy.com.key
SSLCertificateChainFile /etc/httpd/ssl-cert/dummy.chained.crt
ProxyRequests Off
ProxyPreserveHost On
ProxyPass https://dummy.com/api http://localhost:4004
ProxyPassReverse https://dummy.com/api http://localhost:4004
</VirtualHost>