nginx
This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user