I am trying to set up a reverse proxy server in XAMPP to avoid the CORS error which occurs when i try to access an API running on a different port. I have made these changes to my files.
The details of the API are:
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
When I start my Apache server, it does not start and throws an error:
Error: Apache shutdown unexpectedly.
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
Should I continue with XAMPP or use nginx for setting up reverse proxy?