fix: Separate internal and external server URLs for SSL compatibility
- Add PUBLIC_SERVER_URL environment variable for client-side connections - Update /api/config endpoints to return public HTTPS URLs for frontend - Keep internal HTTP URLs for server-to-server communication - Resolves SSL certificate verification issues in admin service - Maintains secure WSS/HTTPS connections for clients
This commit is contained in:
@@ -27,7 +27,7 @@ app.get('/health', (req, res) => {
|
|||||||
// API endpoint to get environment config for client
|
// API endpoint to get environment config for client
|
||||||
app.get('/api/config', (req, res) => {
|
app.get('/api/config', (req, res) => {
|
||||||
res.json({
|
res.json({
|
||||||
serverUrl: process.env.SERVER_URL,
|
serverUrl: process.env.PUBLIC_SERVER_URL || process.env.SERVER_URL,
|
||||||
environment: ENV
|
environment: ENV
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ app.get('/health', (req, res) => {
|
|||||||
// API endpoint to get environment config for client
|
// API endpoint to get environment config for client
|
||||||
app.get('/api/config', (req, res) => {
|
app.get('/api/config', (req, res) => {
|
||||||
res.json({
|
res.json({
|
||||||
serverUrl: process.env.SERVER_URL,
|
serverUrl: process.env.PUBLIC_SERVER_URL || process.env.SERVER_URL,
|
||||||
environment: ENV
|
environment: ENV
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
- PORT=3000
|
- PORT=3000
|
||||||
- SERVER_URL=https://snatchGameServer.interno.com
|
- SERVER_URL=http://snatchgame-server:2567
|
||||||
|
- PUBLIC_SERVER_URL=https://snatchGameServer.interno.com
|
||||||
depends_on:
|
depends_on:
|
||||||
- snatchgame-server
|
- snatchgame-server
|
||||||
networks:
|
networks:
|
||||||
@@ -53,7 +54,8 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
- PORT=3001
|
- PORT=3001
|
||||||
- SERVER_URL=https://snatchGameServer.interno.com
|
- SERVER_URL=http://snatchgame-server:2567
|
||||||
|
- PUBLIC_SERVER_URL=https://snatchGameServer.interno.com
|
||||||
depends_on:
|
depends_on:
|
||||||
- snatchgame-server
|
- snatchgame-server
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
Reference in New Issue
Block a user