Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A more detailed tutorial on reverse proxy configuration? #330

Open
blakebill opened this issue Apr 18, 2022 · 4 comments
Open

A more detailed tutorial on reverse proxy configuration? #330

blakebill opened this issue Apr 18, 2022 · 4 comments
Labels

Comments

@blakebill
Copy link

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!

@TerryGeng
Copy link
Collaborator

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?

@blakebill
Copy link
Author

blakebill commented Apr 21, 2022

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

@azlux
Copy link
Owner

azlux commented Apr 25, 2022

Look like as a playlist update issue

The server don't expect having no payload to give the playlist :

if payload:

But the code requests the /post to update the main view

botamusique/web/js/main.mjs

Lines 267 to 268 in 37666c7

type: 'POST',
url: 'post',

@blakebill
Copy link
Author

blakebill commented Apr 25, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants