fix vite url and proxy_pass url

This commit is contained in:
Cipher Vance
2026-01-25 09:48:06 -06:00
parent dc41ee3119
commit 7d38e2bce2
3 changed files with 15 additions and 4 deletions

9
.env.example Normal file
View File

@@ -0,0 +1,9 @@
# RideAware UI Environment Configuration
# API URL - Set this to override the default
# Development default: http://127.0.0.1:5010
# Production default: https://dev-api.rideaware.org
VUE_APP_API_URL=http://127.0.0.1:5010
# Trainer App URL
VUE_APP_TRAINER_URL=http://localhost:5173

View File

@@ -8,7 +8,7 @@ RUN npm install
COPY . .
ARG VUE_APP_API_URL=https://dev-api.rideaware.org
ARG VUE_APP_API_URL=http://127.0.0.1:5010
ENV VUE_APP_API_URL=$VUE_APP_API_URL
RUN npm run build

View File

@@ -26,13 +26,15 @@ server {
}
# API proxy - strip /api prefix and send to backend
# For local dev, use: http://host.docker.internal:5010 (Mac/Windows) or http://172.17.0.1:5010 (Linux)
# For production, use: https://api.rideaware.org
location /api/ {
# Remove /api prefix when proxying
rewrite ^/api/(.*)$ /$1 break;
proxy_pass https://dev-api.rideaware.org;
proxy_pass http://172.17.0.1:5010;
proxy_http_version 1.1;
proxy_set_header Host dev-api.rideaware.org;
proxy_set_header Host $host;
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;