frontend production/deployment routing for socket.io
The application-server is supposed to run under https://dumux.org/dumux-web-app/. By the 'Alias'-directive an own directory is currently configured in our apache-server with some rights additional granted for accessing the frontend-files. The content for it can be created by running 'npm run build' or 'yarn build'. Currently I have a line in apache-config:
ProxyPass "/dumux-web-app/api" "http://our-awesome-server....:5000/api"
I guess I will need in future need for apache additionally:
ProxyPass "/dumux-web-app/socket.io" "http://our-awesome-server....:5000/socket.io"
for the reverse-proxy, where the backend is supposed to run. This works nice with my branch feature/routing-of-production. I added "basename"-attribute to the <Router>
in App.js there.
The backend is still the developer backend running with -h 0.0.0.0 to bind the host-address, started manually. Calls to '/dumux-web-app/api' go directly to the backend '/api', so the 'Reset' button makes something on the backend.
Many things run fine but the browser tries directly to access '/socket.io' on the webserver where i would expect that it should access '/dumux-web-app/socket.io'. An access like this comes if I press the 'Run' button.
Apache logfile looks like this, for pressing the 'Run' button:
129.69.98.205 - - [26/Aug/2020:21:14:48 +0200] "GET /socket.io/?EIO=3&transport=polling&t=NGiCR18 HTTP/1.1" 404 510 "https://dumux.org/dumux-web-app/run/simulation-1" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0"
And for pressing the 'Reset' button:
129.69.98.205 - - [26/Aug/2020:21:17:09 +0200] "GET /dumux-web-app//api/config?simulationId=simulation-1 HTTP/1.1" 200 1711 "https://dumux.org/dumux-web-ap/config/simulation-1" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0"