Nginx web, proxy and Cloudflare

Hello,

How to configure Nginx web, Nginx proxy, and Cloudflare to avoid the issue with CORS? the webserver hosted on the webdocker.io on “AlmaLinux 8”

Bellow the simple code of HTML and JavaScript. Should I modify it and set proxy? If yes then which one?

<!DOCTYPE HTML>
<html>
<head>
    <title>CCXT Basic example for the browser</title>
    <script type="text/javascript" src="https://unpkg.com/ccxt"></script>
    <script>

        document.addEventListener ("DOMContentLoaded", function () {

            alert ('ccxt version ' + ccxt.version + ' supporting '+ ccxt.exchanges.length.toString () + ' exchanges');

            //const proxy = 'https://cors-anywhere.herokuapp.com/'
            const exchange = new ccxt.bittrex ({ 'proxy': proxy })
            const symbol = 'ETH/BTC'

            exchange.fetchTicker (symbol).then (ticker => {

                const text = [
                    exchange.id,
                    symbol,
                    JSON.stringify (ticker, undefined, '\n\t')
                ]

                document.getElementById ('content').innerHTML = text.join (' ')
            })

        })
    </script>
</head>
<body>
<h1>Hello, CCXT!</h1>
<pre id="content"></pre>
</body>
</html>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.