You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To avoid CORS issues when hosting the Admin and API on different IP addresses, you can use a **relative path** for the backend URL.
73
71
74
-
Talawa-Admin includes a pre-configured Reverse Proxy (via Vite in Dev, and Nginx/Apache in Prod).
72
+
#### Reverse Proxy Configuration (CORS Solution)
73
+
To resolve CORS issues in production environments (where Admin and API run on different IPs), Talawa-Admin is designed to use a **Reverse Proxy**.
75
74
76
-
**Recommended Configuration:**
75
+
**1. React Configuration:**
77
76
```bash
78
77
REACT_APP_TALAWA_URL=/graphql
79
78
REACT_APP_BACKEND_WEBSOCKET_URL=/graphql
79
+
```
80
+
**2. Web Server Configuration:**
81
+
You must configure your web server (Nginx/Apache) to forward these `/graphql` requests to the actual API IP address.
82
+
83
+
-**Docker**: The provided nginx.conf and apache.conf are pre-configured to forward to the internal api container.
84
+
85
+
-**Distributed Systems:** If running on bare metal, update the proxy_pass directive in nginx.conf (or Apache equivalent) to point to your actual API IP Address.
80
86
81
87
#### Setting up REACT_APP_BACKEND_WEBSOCKET_URL in .env file
0 commit comments