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

Pool https error #383

Open
djsmoke2018 opened this issue Aug 26, 2018 · 11 comments
Open

Pool https error #383

djsmoke2018 opened this issue Aug 26, 2018 · 11 comments

Comments

@djsmoke2018
Copy link

what settings must be changed in the pool config when switching to https. as soon as i switch to https i get the error message

Stats API Temporarily Down

without https i have no problems

@mikeyb
Copy link

mikeyb commented Aug 26, 2018 via email

@djsmoke2018
Copy link
Author

djsmoke2018 commented Sep 8, 2018

hi what do you mean forward this to. when i set nginx to forward i get the error message

Stats API Temporarily Down

Usually it's just a temporal issue and mining is not affected.

@stone212
Copy link

stone212 commented Dec 7, 2018

@djsmoke2018 Try this:

# Here is a sample nginx conf file that goes into `/etc/nginx/sites-enabled` and will redirect
#  http to https connections using a letsencrypt certificate.  If you use a different certificate please change the path.
# Assumes your oep install is in /home/openethereumpool/open-ethereum-pool/ and you configured config.json and environment.js correctly


server {
        listen 80; 
        listen [::]:80;
        server_name yourpool.com;
        return 301 https://$host$request_uri;
}

server {
        listen  443 ssl;
        server_name yourpool.com;
        ssl_certificate /etc/letsencrypt/live/yourpool.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/yourpool.com/privkey.pem;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers         HIGH:!aNULL:!MD5;

        root /home/openethereumpool/open-ethereum-pool/www/dist;
        index index.html;

        location / { 
               try_files $uri $uri/ =404;
        }   

        location /api {
                proxy_pass http://api;
        }   
}

upstream api {
    server 127.0.0.1:8080;
}

Please close issue if this works.

@bunkerGrin
Copy link

i tried several nginx config and im unable to access the frontend under SSL, allways receive the api error

@stone212
Copy link

@bunkerGrin

That is not a very helpful comment. Did you try my sample config above? What exactly happened when you tried it?

@bali105
Copy link

bali105 commented Apr 1, 2020

@stone212

Hello, have tried you config, still having error message "Stats API Temporarily Down".
Here is my config

  server {
    listen 80; 
    listen [::]:80;
    server_name mypool.com www.mypool.com;
    return 301 https://$host$request_uri;
  }

  server {
    listen  443 ssl;
    server_name mypool.com www.mypool.com;

    ssl_certificate /etc/letsencrypt/live/mypool.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/mypool.com/privkey.pem; # managed by Certbot
    ssl_dhparam /etc/nginx/dhparam.pem;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers         HIGH:!aNULL:!MD5;

    root /home/ibm/open-ethereum-pool/www/dist;
    index index.html;

    location / { 
           try_files $uri $uri/ =404;
  }   

    location /api {
            proxy_pass http://api;
    }   
}

 upstream api {
 server 127.0.0.1:8080;
}

Http version without redirecting to https just working grate, no any problem.
Port 443 on router is opened. Also ports 80, 8080, 8008, 8888 are opened.

@mikeyb
Copy link

mikeyb commented Apr 1, 2020

If you leave this as is:

    location /api {
            proxy_pass http://api;
    }   

What errors do you get? nginx is acting as a proxy to the api, the api only works over http if i remember correctly.

In simple terms, there is an https connection from the user on the internet, to the webserver. Once nginx receives that request on the ssl port, it forwards the request to the api over http.

So in the end, you should just be leaving your location /api using http in the proxy_pass setting

@bali105
Copy link

bali105 commented Apr 1, 2020

@mikeyb
The error is:
"Stats API Temporarily Down
Usually it's just a temporal issue and mining is not affected."

@mikeyb
Copy link

mikeyb commented Apr 1, 2020

You get that using proxy_pass http://api;?

Make sure the api is running on port 8080 as well as you have defined in the upstream

@bali105
Copy link

bali105 commented Apr 1, 2020

@mikeyb

You get that using proxy_pass http://api;?

Isn't it what i mentioned above in my config file? :)

Make sure the api is running on port 8080 as well as you have defined in the upstream

Also mentioned above :)

Http version without redirecting to https just working grate, no any problem.

so i guess there is no problem with api setup, it is relate to any SSL connection setup

@mikeyb
Copy link

mikeyb commented Apr 2, 2020

https://nginx.org/en/docs/ ;)

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

No branches or pull requests

5 participants