cklester Well-Known Member Licensed User Dec 2, 2020 #1 I've downloaded the ServerExampleNoMySQL.b4j project from [WebApp] Web Apps Overview. It is now running at B4XDev.com/webapp/. However, some of the pages don't seem to be loading correctly (e.g., the Quiz App). I am passing websocket requests thru nginx. Here, the relevant parts, is my config file for that: B4X: server { location /webapp/ { proxy_pass http://127.0.0.1:51042/; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $http_x_forwarded_for; proxy_redirect http://$host:51042/ http://$host/webapp/; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } So, I have the Upgrade and Connection headers set. What might be wrong? Last edited: Dec 2, 2020
I've downloaded the ServerExampleNoMySQL.b4j project from [WebApp] Web Apps Overview. It is now running at B4XDev.com/webapp/. However, some of the pages don't seem to be loading correctly (e.g., the Quiz App). I am passing websocket requests thru nginx. Here, the relevant parts, is my config file for that: B4X: server { location /webapp/ { proxy_pass http://127.0.0.1:51042/; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $http_x_forwarded_for; proxy_redirect http://$host:51042/ http://$host/webapp/; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } So, I have the Upgrade and Connection headers set. What might be wrong?
Erel B4X founder Staff member Licensed User Longtime User Dec 3, 2020 #2 It works when you access the server directly: http://b4xdev.com:51042/smiley/index.html This means that the proxy is indeed misconfigured. It cannot find the b4j_ws.js file: This happens before the connection is upgraded to WebSocket. Upvote 0
It works when you access the server directly: http://b4xdev.com:51042/smiley/index.html This means that the proxy is indeed misconfigured. It cannot find the b4j_ws.js file: This happens before the connection is upgraded to WebSocket.
cklester Well-Known Member Licensed User Dec 3, 2020 #3 So, if I'm proxying the server, does that mean I have to rearrange resources (like, move the b4j_ws.js file so B4J server (or nginx(?)) sees it) or update links in the HTML files (maybe use "../b4j_ws.js")? Or should it work as-is? Upvote 0
So, if I'm proxying the server, does that mean I have to rearrange resources (like, move the b4j_ws.js file so B4J server (or nginx(?)) sees it) or update links in the HTML files (maybe use "../b4j_ws.js")? Or should it work as-is?
cklester Well-Known Member Licensed User Dec 3, 2020 #4 I set it up at B4XDev.com, and it works fine. So it's the subdirectory that's fouling things up... Upvote 0