fixed readme
This commit is contained in:
parent
4ef248d53a
commit
aae1db265a
39
README.md
39
README.md
@ -100,6 +100,45 @@ The frontend will be available at http://localhost:3000
|
|||||||
- Ensure all environment variables are properly set in your production environment
|
- Ensure all environment variables are properly set in your production environment
|
||||||
- Never commit `.env` files to version control
|
- Never commit `.env` files to version control
|
||||||
|
|
||||||
|
## Frontend Routing in Production
|
||||||
|
|
||||||
|
In production, the frontend is served through nginx. To ensure client-side routing works correctly:
|
||||||
|
|
||||||
|
1. **Nginx Configuration**
|
||||||
|
- Ensure your nginx configuration includes the following directive to handle unknown routes:
|
||||||
|
```nginx
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **React Router Configuration**
|
||||||
|
- Set the `basename` dynamically based on the environment:
|
||||||
|
- In production, set `basename="/dashboard"`.
|
||||||
|
- In development, set `basename="/"`.
|
||||||
|
|
||||||
|
3. **Navigation Links**
|
||||||
|
- Use relative paths in your navigation links (e.g., `to="canvas/canvas-endpoints"` instead of `to="/dashboard/canvas/canvas-endpoints"`).
|
||||||
|
|
||||||
|
## HTTPS with Self-Signed Certificates
|
||||||
|
|
||||||
|
To run the application with HTTPS using a self-signed certificate:
|
||||||
|
|
||||||
|
1. **Generate a Self-Signed Certificate**
|
||||||
|
```bash
|
||||||
|
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ./nginx/ssl/nginx.key -out ./nginx/ssl/nginx.crt
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Update Docker Compose**
|
||||||
|
- Ensure your `docker-compose.yml` mounts the certificate files in the nginx service:
|
||||||
|
```yaml
|
||||||
|
volumes:
|
||||||
|
- ./nginx/ssl:/etc/nginx/ssl
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Nginx Configuration**
|
||||||
|
- Use the production nginx configuration that includes SSL settings.
|
||||||
|
|
||||||
## Development Best Practices
|
## Development Best Practices
|
||||||
|
|
||||||
1. **Database Management**
|
1. **Database Management**
|
||||||
|
Loading…
Reference in New Issue
Block a user