Skip to content

JSON-G/apache-conf-react-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Apache Reverse Proxy Configuration for create-react-app

Basically, put the lines below on the Apache config file (httpd.conf)

<VirtualHost *:80>
  ProxyRequests Off
  ProxyErrorOverride Off
  ProxyPass /react-app http://localhost:3000/
  ProxyPassReverse /react-app http://localhost:3000/
</VirtualHost>

  • the /react-app folder should reside at htdocs and the app should be running at http://localhost:3000/
  • to access, simply go to localhost:80/react-app
  • 80 is the port Apache is running on

After editing the Apache config file, need to explicitly write the code for the correct bundle.js
on the index.html file since the original bundle.js will result in 404

example: <script src="http://localhost/react-app/static/js/bundle.js"></script> (recommended to be placed after body tags)

About

Apache Reverse Proxy Configuration for create-react-app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published