Try to avoid mixed-mode
Some checks failed
Podman Rootless Demo / test-backend (push) Has been skipped
Podman Rootless Demo / test-frontend (push) Successful in 11s
Podman Rootless Demo / build-backend (push) Has been skipped
Podman Rootless Demo / build-frontend (push) Failing after 53s
Podman Rootless Demo / deploy-prod (push) Has been skipped
Some checks failed
Podman Rootless Demo / test-backend (push) Has been skipped
Podman Rootless Demo / test-frontend (push) Successful in 11s
Podman Rootless Demo / build-backend (push) Has been skipped
Podman Rootless Demo / build-frontend (push) Failing after 53s
Podman Rootless Demo / deploy-prod (push) Has been skipped
This commit is contained in:
parent
2feec4ea98
commit
68873ec424
2 changed files with 10 additions and 9 deletions
|
|
@ -13,7 +13,8 @@ import axios from 'axios';
|
|||
|
||||
const API_HOST = process.env.NEXT_PUBLIC_API_HOST || '127.0.0.1';
|
||||
const API_PORT = process.env.NEXT_PUBLIC_API_PORT || '3001';
|
||||
const API_BASE_URL = `http://${API_HOST}:${API_PORT}`;
|
||||
// Use API path for production (through nginx reverse proxy) or direct URL for development
|
||||
const API_BASE_URL = process.env.NODE_ENV === 'production' ? '/api' : `http://${API_HOST}:${API_PORT}`;
|
||||
|
||||
export interface User {
|
||||
id: string;
|
||||
|
|
|
|||
|
|
@ -37,13 +37,13 @@ http {
|
|||
}
|
||||
|
||||
# backend API
|
||||
# location /api/ {
|
||||
# proxy_http_version 1.1;
|
||||
# proxy_set_header Host $host;
|
||||
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
# proxy_set_header X-Forwarded-Proto $scheme;
|
||||
# proxy_set_header Connection "";
|
||||
# proxy_pass http://127.0.0.1:${PROD_BACKEND_PORT}/;
|
||||
# }
|
||||
location /api/ {
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Connection "";
|
||||
proxy_pass http://127.0.0.1:${PROD_BACKEND_PORT}/;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue