oliverw / miningcore

Miningcore is a high-performance Mining Pool Software for Linux and Windows.
https://store.miningcore.pro
MIT License
724 stars 664 forks source link

http://localhost:4000 #1691

Closed M1neK1ng closed 1 year ago

M1neK1ng commented 1 year ago

is it me or API doesnt work? lynx 127.0.0.1:4000 gives 404 if i bind api to 0.0.0.0:4000 it 404's and if i proxy_pass is nginx it is also 404

ghost commented 1 year ago

use 127.0.0.1:4000/api/

WantClue commented 1 year ago

Take a look at the wiki page for the API. it's 127.0.0.1:4000/api/pools/...

image

M1neK1ng commented 1 year ago

Hello, Thank you everyone for your input. Because the documentation was pointing to server:4000/api I was lead to believe that /api itself would return values but instead returned a 404 and for some reason, the documented endpoint calls were returning an "internal server error". I restarted Miningcore a few times and still had the same issue. Finally I just restarted the whole server last night and like magic the issue went away and api was functioning. I dont know why i was getting an internal server error since it was a fresh install from about two weeks ago and havent changed anything except for the pool configurations. I believe the api didnt bind correctly because the port my been used by another resource during launch? idk just speculation... Anyway thanks for the help, the issue has been resolved.

ghost commented 1 year ago

It can cause an error or a 404 error if the web server is not configured as a reverse proxy to the api. The miningcore api server is only capable of http communication. If the web interface works on https, port 4000 reverse proxy in nginx configuration (/etc/nginx/sites-enabled/) is required

Example:

server {

    root /var/www/yourdomain/html;

index index.html index.htm index.nginx-debian.html;

    server_name yourdomain;

    location / {

            try_files $uri $uri/ =404;

        }
    location /api/ {
    proxy_pass http://127.0.0.1:4000/api/;
        }
M1neK1ng commented 1 year ago

Hi, Thanks for the info. I already have it setup and the website is running. Thanks!