diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 0000000..e4128d3 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,16 @@ +[[redirects]] + from = "/live/*" + to = "https://jupiter.nearle.app/live/:splat" + status = 200 + force = true + +[[redirects]] + from = "/api/*" + to = "https://api.workolik.com/api/:splat" + status = 200 + force = true + +[[redirects]] + from = "/*" + to = "/index.html" + status = 200 diff --git a/nginx.sample.conf b/nginx.sample.conf new file mode 100644 index 0000000..ac7a274 --- /dev/null +++ b/nginx.sample.conf @@ -0,0 +1,37 @@ +# 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; + } + + # Serve the React application + location / { + root /path/to/your/dist; + try_files $uri $uri/ /index.html; + } +} diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..08bb4b9 --- /dev/null +++ b/vercel.json @@ -0,0 +1,16 @@ +{ + "rewrites": [ + { + "source": "/live/:path*", + "destination": "https://jupiter.nearle.app/live/:path*" + }, + { + "source": "/api/:path*", + "destination": "https://api.workolik.com/api/:path*" + }, + { + "source": "/(.*)", + "destination": "/index.html" + } + ] +}