I am working on an angular app with rest api integrated, rest api are built with golang so running on 8080 port. I have used httpclient method to load data from api so its first sending OPTIONS request to server which takes time and then loads actual data. I want to get rid of this options request, one of the solutions suggested to set proxy to load api from same server where the app is hosted suppose mmy app is on example.com and api are on example.com:8080 and I want to set proxy for example.com:8080 as example.com
Not sure if its possible or not , I tried following but it didnt work
NameVirtualHost *:80
<VirtualHost *:80>
ServerName example.com:8080
ServerAlias www.example.com:8080
ProxyRequests off
ProxyPass / http://example.com/
ProxyPassReverse / http://example.com/
</VirtualHost>
My app and api both are hosted on aws ec2 instance
The *:8080 should beon the ProxyPass/ProxyPassReverse and NOT on the ServerName/ServerAlias.