1/11/2024 10:14 AM | |
Joined: 6/11/2023 Last visit: 9/18/2024 Posts: 7 Rating: (1) |
Hi, I am developing and application for deploying on a siemens industrial edge device. The application includes a backend server (in Django) and a frontend UI (in react). I have packaged the application with an NGINX server with proxy_pass for the backend. Simplified architecture in the picture attached. So when running on a server I can reach the backend at http://myserver/api which I can set as the base URL for all my API calls (using Axios) from the UI to my backend. Now when publishing my Industrial Edge Manager what should I set as my base URL for api calls? What would be the server address for the application when deployed on the industrial edge device? Is there a default address for the NGINX server running on the industrial edge device? I hope I have articulated the question properly. Let me know if I can share more information to clarify the situation. |
1/11/2024 1:48 PM | |
Joined: 3/8/2017 Last visit: 11/12/2024 Posts: 16 Rating: (3) |
Hi, Since you are only communicating within your App/inside of the Edge Device, there is no need to use a custom URL. You can simply use the service name (like a DNS name) of the docker services(containers) you defined. See further explanation https://docs.docker.com/compose/networking/ If you use seperate Apps for the different services, your containers can join an "external network" created by the main app and communicate via the internal service names. For accessing your application you can use port forwarding like shown in your schematic. Further down the road you might decide to use our integrated reverse proxy. You can find further information and guides under https://docs.eu1.edge.siemens.cloud/ |
1/11/2024 7:37 PM | |
Joined: 6/11/2023 Last visit: 9/18/2024 Posts: 7 Rating: (1) |
Hi Berle_C, Thanks for the response. I actually do have 2 separate services (as shown in the architecture) one for the backend and one for the frontend ui. The services are joined on a network but the problem comes with the API calls from the frontend to the backend. These are client side API calls so both the frontend and the backend need to be accessible. I understand that I can create multiple proxies for the created application using the integrated NGINX reverse proxy.
But when I use the integrated proxy server would be the address for the service if I need to hardcoded in my software? i.e. what exact address would the service be accessible from if the app needs to be deployed on multiple device would they all be different? I think the answer is yes but surely this is would be a problem faced by many applications (all those that use client side rendering with API calls). What is the recommended way of doing this? Thanks, Saad |
Follow us on