deploiement: reverse proxy nginx pour rediriger les requetes au front ou back suivant url

This commit is contained in:
Mathieu Oriol
2024-09-15 17:21:31 +02:00
parent 0f2d0dc86a
commit 616f42880d
8 changed files with 77 additions and 24 deletions

View File

@@ -17,7 +17,12 @@ export function EnemyTeamModal({ visible, onClose }) {
imageRef.current.src = SERVER_URL + "/photo/enemy?team=" + teamId.toString() + "&t=" + new Date().getTime();
}
const SERVER_URL = "https://" + process.env.NEXT_PUBLIC_SOCKET_HOST + ":" + process.env.NEXT_PUBLIC_SOCKET_PORT;
var protocol = "https://";
if (process.env.NEXT_PUBLIC_SOCKET_HOST == "localhost") {
protocol = "http://";
}
const SERVER_URL = protocol + process.env.NEXT_PUBLIC_SOCKET_HOST + "/back";
console.log(SERVER_URL);
return (visible &&
<>
<div className='fixed w-screen h-screen bg-black bg-opacity-50 z-10 text-center'></div>