botamusique icon indicating copy to clipboard operation
botamusique copied to clipboard

A more detailed tutorial on reverse proxy configuration?

Open blakebill opened this issue 4 years ago • 4 comments

To be honest, I can't understand the wiki for reverse proxies, I only know a few things about nginx, I would like to have a clearer comment, or a more complete configuration file for learning and modification.

By the way what error would cause '"POST /post HTTP/1.1" 400‘, I think its maybe ajax's problem? Because I've had this problem since I redeployed and I can't see the playlist change before refreshing the page.

Thanks a lot for everyone who worked for this project, I think its the best music bot!

blakebill avatar Apr 18 '22 02:04 blakebill

In general, the usage of reverse proxy in Nginx is well-documented at https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/. I would refer you to the link above to learn more about it.

The section you refer to in the wiki is not supposed to serve as a complete guide to reverse proxy, but more like a handy snippet to start with.

Anyways, personally, I would be happy to offer help. Can you post your Nginx configuration file and the log of the bot and Nginx when this error happens?

TerryGeng avatar Apr 18 '22 13:04 TerryGeng

Thanks! I have successfully set up reverse proxy. About 400 Problem, I cant solve it, here is the log. Web log

 * Running on all addresses (0.0.0.0)
   WARNING: This is a development server. Do not use it in a production deployment.
 * Running on http://127.0.0.1:8181
 * Running on http://172.17.59.238:8181 (Press CTRL+C to quit)
101.228.255.49 - - [21/Apr/2022 14:37:03] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:05] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:06] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:08] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:09] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:11] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:12] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:14] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:15] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:17] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:18] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:20] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:21] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:22] "GET / HTTP/1.1" 200 -
101.228.255.49 - - [21/Apr/2022 14:37:22] "[36mGET /static/css/main.css HTTP/1.1[0m" 304 -
101.228.255.49 - - [21/Apr/2022 14:37:22] "[36mGET /static/image/loading.svg HTTP/1.1[0m" 304 -
101.228.255.49 - - [21/Apr/2022 14:37:22] "[36mGET /static/image/logo.png HTTP/1.1[0m" 304 -
101.228.255.49 - - [21/Apr/2022 14:37:22] "[36mGET /static/image/empty_box.svg HTTP/1.1[0m" 304 -
101.228.255.49 - - [21/Apr/2022 14:37:22] "[36mGET /static/image/unknown-album.png HTTP/1.1[0m" 304 -
101.228.255.49 - - [21/Apr/2022 14:37:22] "[36mGET /static/js/main.js HTTP/1.1[0m" 304 -
101.228.255.49 - - [21/Apr/2022 14:37:22] "GET /library/info HTTP/1.1" 200 -
101.228.255.49 - - [21/Apr/2022 14:37:23] "GET /library/info HTTP/1.1" 200 -
101.228.255.49 - - [21/Apr/2022 14:37:23] "GET /playlist HTTP/1.1" 200 -
101.228.255.49 - - [21/Apr/2022 14:37:23] "POST /library HTTP/1.1" 200 -
101.228.255.49 - - [21/Apr/2022 14:37:23] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:24] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:25] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:26] "GET / HTTP/1.1" 200 -
101.228.255.49 - - [21/Apr/2022 14:37:26] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:26] "[36mGET /static/css/main.css HTTP/1.1[0m" 304 -
101.228.255.49 - - [21/Apr/2022 14:37:26] "[36mGET /static/image/logo.png HTTP/1.1[0m" 304 -
101.228.255.49 - - [21/Apr/2022 14:37:26] "[36mGET /static/image/loading.svg HTTP/1.1[0m" 304 -
101.228.255.49 - - [21/Apr/2022 14:37:26] "[36mGET /static/image/empty_box.svg HTTP/1.1[0m" 304 -
101.228.255.49 - - [21/Apr/2022 14:37:26] "[36mGET /static/image/unknown-album.png HTTP/1.1[0m" 304 -
101.228.255.49 - - [21/Apr/2022 14:37:26] "[36mGET /static/js/main.js HTTP/1.1[0m" 304 -
101.228.255.49 - - [21/Apr/2022 14:37:26] "GET /library/info HTTP/1.1" 200 -
101.228.255.49 - - [21/Apr/2022 14:37:26] "GET /library/info HTTP/1.1" 200 -
101.228.255.49 - - [21/Apr/2022 14:37:27] "POST /library HTTP/1.1" 200 -
101.228.255.49 - - [21/Apr/2022 14:37:27] "GET /playlist HTTP/1.1" 200 -
101.228.255.49 - - [21/Apr/2022 14:37:27] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:28] "GET /library/info HTTP/1.1" 200 -
101.228.255.49 - - [21/Apr/2022 14:37:28] "POST /library HTTP/1.1" 200 -
101.228.255.49 - - [21/Apr/2022 14:37:29] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:29] "GET /library/info HTTP/1.1" 200 -
101.228.255.49 - - [21/Apr/2022 14:37:29] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:29] "POST /library HTTP/1.1" 200 -
101.228.255.49 - - [21/Apr/2022 14:37:30] "GET /library/info HTTP/1.1" 200 -
101.228.255.49 - - [21/Apr/2022 14:37:30] "[31m[1mPOST /post HTTP/1.1[0m" 400 -
101.228.255.49 - - [21/Apr/2022 14:37:30] "POST /library HTTP/1.1" 200 -
101.228.255.49 - - [21/Apr/2022 14:37:32] "POST /post HTTP/1.1" 200 -

In Edge F12: POST https://doamin.com/post 400 send @ xhr.js:151 ajax @ ajax.js:699 jQuery.ajax @ ajax.js:11 Ta @ main.mjs:266 xhr.js:151

blakebill avatar Apr 21 '22 06:04 blakebill

Look like as a playlist update issue

The server don't expect having no payload to give the playlist : https://github.com/azlux/botamusique/blob/0650e7279f5f777cbeda51b9b40fb4155c60d227/interface.py#L339

But the code requests the /post to update the main view https://github.com/azlux/botamusique/blob/37666c7daf43f12d47e5bd37af1ab86f36f84dcd/web/js/main.mjs#L267-L268

azlux avatar Apr 25 '22 15:04 azlux

I think so, I have to refresh the page to see the playlist update.

blakebill avatar Apr 25 '22 15:04 blakebill