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 resolve CORS issues in production environments (where Admin and API run on different IPs), Talawa-Admin is designed to use a **Reverse Proxy**.
74
-
75
-
**1. React Configuration:**
76
-
```bash
77
-
REACT_APP_TALAWA_URL=/graphql
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.
55
+
**Configuration Examples by Scenario:**
82
56
83
-
-**Docker**: The provided nginx.conf and apache.conf are pre-configured to forward to the internal api container.
57
+
| Scenario | Deployment Type | API Location |`.env` Configuration | Notes |
58
+
| :--- | :--- | :--- | :--- | :--- |
59
+
|**1**|**Docker**| Same System (Localhost) |`REACT_APP_TALAWA_URL=http://localhost:4000/graphql`| The internal Nginx container handles the proxy automatically. |
60
+
|**2**|**Docker**| Different Systems (Remote) |`REACT_APP_TALAWA_URL=http://<SERVER_IP>:4000/graphql`| Users access the Admin app via the Server IP. Nginx proxies requests internally. |
61
+
|**3**|**Manual (Dev Mode)**| Same System (Localhost) |`REACT_APP_TALAWA_URL=http://localhost:4000/graphql`| The Vite dev server proxies requests to localhost:4000. |
62
+
|**4**|**Manual (Dev Mode)**| Different Systems (Remote) |`REACT_APP_TALAWA_URL=http://<API_IP>:4000/graphql`| Set this to the IP of the machine running the API. Vite will proxy requests there. |
84
63
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.
64
+
**Important for Manual Production Builds:**
65
+
If you are deploying a production build manually without Docker, the Vite Dev Server is not active. You must configure your web server (Nginx or Apache) to forward requests from `/graphql` to your API URL, similar to the rules found in `config/docker/setup/`.
86
66
87
67
#### Setting up REACT_APP_BACKEND_WEBSOCKET_URL in .env file
0 commit comments