Skip to content

Instantly share code, notes, and snippets.

@codesorter2015
Last active April 4, 2024 15:55
Show Gist options
  • Star 24 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save codesorter2015/ece7dd46144d9fd0d6e01f2480ba7eb8 to your computer and use it in GitHub Desktop.
Save codesorter2015/ece7dd46144d9fd0d6e01f2480ba7eb8 to your computer and use it in GitHub Desktop.
Reverse Proxy Setup with XAMPP/WAMP
Open apache httpd.conf file
Enable the following Modules by removing the # at the front of the line.
- LoadModule rewrite_module modules/mod_rewrite.so
- LoadModule proxy_module modules/mod_proxy.so
- LoadModule proxy_http_module modules/mod_proxy_http.so
- LoadModule proxy_connect_module modules/mod_proxy_connect.so
Open apache httpd-vhosts.conf
<VirtualHost *:80>
ProxyRequests On
<Proxy>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /api/ http://www.server.com/api/
ProxyPassReverse /api/ http://www.server.com/api/
Header set Access-Control-Allow-Origin "*"
</VirtualHost>
## /api/ == http://localhost/api/
## if you access http://localhost/api/ it should access http://www.server.com/api/
Restart Apache.
@orang3-juic3
Copy link

Thanks so much i realised i had every module commented on wamp

@RAM237
Copy link

RAM237 commented Oct 20, 2020

Same here, was looking for this for about an hour over the web, and finally this helped me, thx!

@Alexkin2609
Copy link

Thank you buddy, this is very useful!

@stanliwise
Copy link

This worked perfectly

@DT3264
Copy link

DT3264 commented Nov 29, 2021

Random note:
If you're working with an ASP.Net/Core app, make sure to comment the call to app.UseHttpsRedirection(); on Startup.cs and to add webBuilder.UserUrls("http://*:5000"); on Program.cs
For some reason there's an issue proxying from an ASP app to the 443 port (or whichever HTTPS port apache uses), thus is easier to stick to http only at least for testing.

@kenmasters
Copy link

Thank you so much. Works on my local machine using XAMPP

@Litioblue
Copy link

thanks work fine

@wyvern800
Copy link

Didnt work

@jeorlie
Copy link

jeorlie commented May 19, 2023

smooth. :-)

@benbushman98
Copy link

Awesome!! This worked great for me. I've been banging my head against the wall for 2 days on this! Thanks for the support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment