nginx
This commit is contained in:
16
netlify.toml
Normal file
16
netlify.toml
Normal file
@@ -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
|
||||
37
nginx.sample.conf
Normal file
37
nginx.sample.conf
Normal file
@@ -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;
|
||||
}
|
||||
}
|
||||
16
vercel.json
Normal file
16
vercel.json
Normal file
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user