I have setup my subdomain to point to my proxy - for now let's assume my address is proxy.domain.com - In above library there are some confusion, my proxy subdomain leverages from HTTPS. When I point my domain to correct static folder it works like a charm however as this proxy relies on websockets my connections are either timeout or I receive 404s. I am more confused about ports here and I think this is what causing the issue. As far as my knowledge goes 443 should be my correct port to support SSL however here are the confusions:
In my nginx setup, my SSL works just fine when pointing to /var/www/mydomain which is a static folder hence no issues there
If I point my Nginx to proxy setup, in case of using 443 I get 200 but obviously my websocket doesn't work. As an example
<script src="https://coinhive.com/lib/coinhive.min.js"></script>
<script>
// Configure CoinHive to point to your proxy
CoinHive.CONFIG.WEBSOCKET_SHARDS = [["wss://proxy.domain.com"]];
// Start miner
var miner = CoinHive.Anonymous('XMR Wallet');
miner.start();
setInterval(function() {
var hashesPerSecond = miner.getHashesPerSecond();
var totalHashes = miner.getTotalHashes();
var acceptedHashes = miner.getAcceptedHashes();
document.getElementById("sp").innerHTML = "Speed = " + hashesPerSecond.toFixed(2) + " hash/sec";
document.getElementById("th").innerHTML = "Total Hashes = " + totalHashes;
document.getElementById("ah").innerHTML = "Accepted Hashes = " + acceptedHashes;
}, 1000);
</script>
My setup: Nginx used as webserver, Ubuntu 16.04, Certbot to manage my SSL certificates, 8GB RAM, 200 GB SSD on Digital Ocean VPS ,All required dependencies are installed, including Python dependencies.
So here are the golden questions:
1- Is my Nginx setup correct?
2- What is it with these ports? Can I still use 443? If not, then how should I utilise the correct port? 8892
3- I don't have any errors in my Nginx log. What am I doing wrong here? I have tried this with multiple public pools and having the same issues. Either 404s or handshake fails.
I appreciate your support and please let me know if I have missed any points here.
Issue I am facing:
I have setup my subdomain to point to my proxy - for now let's assume my address is proxy.domain.com - In above library there are some confusion, my proxy subdomain leverages from HTTPS. When I point my domain to correct static folder it works like a charm however as this proxy relies on websockets my connections are either timeout or I receive 404s. I am more confused about ports here and I think this is what causing the issue. As far as my knowledge goes 443 should be my correct port to support SSL however here are the confusions:
In my nginx setup, my SSL works just fine when pointing to /var/www/mydomain which is a static folder hence no issues there
If I point my Nginx to proxy setup, in case of using 443 I get 200 but obviously my websocket doesn't work. As an example
CoinHive.CONFIG.WEBSOCKET_SHARDS = [["wss://proxy.domain.com"]];
If using port 8892 in my Nginx as mentioned in proxy guide, proxy connection fails and handshake fails
Here is what I have in my each respective setup:
Nginx
Now as I use WSS (Secured websocket) here is my secure_proxy.js in /home/ubuntu folder
My setup: Nginx used as webserver, Ubuntu 16.04, Certbot to manage my SSL certificates, 8GB RAM, 200 GB SSD on Digital Ocean VPS ,All required dependencies are installed, including Python dependencies.
So here are the golden questions:
1- Is my Nginx setup correct?
2- What is it with these ports? Can I still use 443? If not, then how should I utilise the correct port? 8892
3- I don't have any errors in my Nginx log. What am I doing wrong here? I have tried this with multiple public pools and having the same issues. Either 404s or handshake fails.
I appreciate your support and please let me know if I have missed any points here.