Apache config for dealing with React and FastAPI application

<Directory "/usr/local/www/MyReactApp">
Options +SymLinksIfOwnerMatch

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.html [QSA,L]
</Directory>

ProxyPreserveHost On

ProxyPass /backend/ http://127.0.0.1:9009/api/
ProxyPassReverse /backend/ http://127.0.0.1:9009/api/

As always adopt to the needs.

Leave a Reply

Your email address will not be published. Required fields are marked *

Blue Captcha Image Refresh

*