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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome!! This worked great for me. I've been banging my head against the wall for 2 days on this! Thanks for the support!