50 lines
1.6 KiB
Plaintext
50 lines
1.6 KiB
Plaintext
# If you are hosting this on your own Nginx server, you must add these
|
|
# location blocks to your configuration to proxy the API requests,
|
|
# otherwise Nginx will just return the React index.html for API calls!
|
|
|
|
server {
|
|
# ... your existing config ...
|
|
|
|
# Proxy REST API requests to jupiter
|
|
location /live/ {
|
|
proxy_pass https://jupiter.nearle.app/live/;
|
|
proxy_set_header Host jupiter.nearle.app;
|
|
proxy_ssl_server_name on;
|
|
|
|
# Optional: forward client IP
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_addrs;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
# Proxy GraphQL API requests to legacy backend
|
|
location /api/ {
|
|
proxy_pass https://api.workolik.com/api/;
|
|
proxy_set_header Host api.workolik.com;
|
|
proxy_ssl_server_name on;
|
|
|
|
# Optional: forward client IP
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_addrs;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
# Proxy GraphQL v1 queries (e.g. /v1/graphql) to legacy backend
|
|
location /v1/ {
|
|
proxy_pass https://api.workolik.com/v1/;
|
|
proxy_set_header Host api.workolik.com;
|
|
proxy_ssl_server_name on;
|
|
|
|
# Optional: forward client IP
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_addrs;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
# Serve the React application
|
|
location / {
|
|
root /path/to/your/dist;
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|