Hasura proxy updated
This commit is contained in:
@@ -27,8 +27,8 @@ RUN rm -rf ./*
|
|||||||
# Copy the compiled static assets FROM THE BUILDER STAGE
|
# Copy the compiled static assets FROM THE BUILDER STAGE
|
||||||
COPY --from=builder /app/dist/ .
|
COPY --from=builder /app/dist/ .
|
||||||
|
|
||||||
# Copy your custom Nginx configuration
|
# Copy the Nginx configuration as a template so env variables (like HASURA_ADMIN_SECRET) are substituted at runtime
|
||||||
COPY nginx.conf /etc/nginx/nginx.conf
|
COPY nginx.conf /etc/nginx/templates/default.conf.template
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<link rel="icon" type="image/png" href="/favicon.png" />
|
<link rel="icon" type="image/png" href="/favicon.png" />
|
||||||
<title>nearledaily</title>
|
<title>Nearle Daily</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|||||||
33
nginx.conf
33
nginx.conf
@@ -1,18 +1,25 @@
|
|||||||
events {}
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
http {
|
# Serve the React App
|
||||||
include /etc/nginx/mime.types;
|
location / {
|
||||||
default_type application/octet-stream;
|
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 {
|
# Proxy /hasura to the live API, exactly like Vite dev server does
|
||||||
listen 80;
|
location /hasura/ {
|
||||||
server_name localhost;
|
proxy_pass https://api.workolik.com/api/rest/;
|
||||||
|
proxy_set_header x-hasura-admin-secret "${HASURA_ADMIN_SECRET}";
|
||||||
|
proxy_ssl_server_name on;
|
||||||
|
|
||||||
location / {
|
# Pass standard proxy headers
|
||||||
root /usr/share/nginx/html;
|
proxy_set_header Host api.workolik.com;
|
||||||
index index.html index.htm;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
# This line forces Nginx to pass routing back to React Router
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
try_files $uri $uri/ /index.html;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user