Last active
November 18, 2024 19:44
-
-
Save codesorter2015/ece7dd46144d9fd0d6e01f2480ba7eb8 to your computer and use it in GitHub Desktop.
Reverse Proxy Setup with XAMPP/WAMP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Same here, was looking for this for about an hour over the web, and finally this helped me, thx!
Thank you buddy, this is very useful!
This worked perfectly
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.
Thank you so much. Works on my local machine using XAMPP
thanks work fine
Didnt work
smooth. :-)
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
Thanks so much i realised i had every module commented on wamp