# When you are redirecting to any url, which is handled by react-router # on nginx we need special configuration to handle those # and don't just return 404 server { listen 80; server_name localhost; index index.html; root /usr/share/nginx/html; location ~ \.(js|css)$ { # allow returning 404s for assets } location / { try_files $uri /index.html; } # forbid environment files download location ~ ^/\.env\. { deny all; } }