Hasura proxy updated

This commit is contained in:
2026-06-15 19:45:17 +05:30
parent 61a9373399
commit f907926855
3 changed files with 24 additions and 17 deletions

View File

@@ -1,18 +1,25 @@
events {}
server {
listen 80;
server_name localhost;
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Serve the React App
location / {
root /usr/share/nginx/html;
index index.html index.htm;
# Force Nginx to pass routing back to React Router
try_files $uri $uri/ /index.html;
}
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
# This line forces Nginx to pass routing back to React Router
try_files $uri $uri/ /index.html;
}
# Proxy /hasura to the live API, exactly like Vite dev server does
location /hasura/ {
proxy_pass https://api.workolik.com/api/rest/;
proxy_set_header x-hasura-admin-secret "${HASURA_ADMIN_SECRET}";
proxy_ssl_server_name on;
# Pass standard proxy headers
proxy_set_header Host api.workolik.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}