1.Modify your Nginx Vhost Files. For example.Listen on 443 port.
2.When we want to visit this proxy.will throuth https://cors.<domain>.com:8080.
so we need modify cors-anywhere.
Another way is to deploy a standalone CORS Anywhere application,
but you need to make some modifications to the native server.js to support the HTTPS protocol.
To put it simply, read the certificate file
(make sure the current user user has read and write access
to the certificate file) as a parameter to the httpsOptions option
and pass it to the https.createServer() method.
chmod -R 0770 /etc/letsencrypt/live/chown -R root:user /etc/letsencrypt/live/ |
1
2
3
4
5
6
7
8
9
10
11
12
13
| // server-standalone.jsvar fs = require('fs');// ...var cors_proxy = require('./lib/cors-anywhere');cors_proxy.createServer({ httpsOptions: { key: fs.readFileSync('/etc/letsencrypt/live/cors.<domain>.com/privkey.pem'), cert: fs.readFileSync('/etc/letsencrypt/live/cors.<domain>.com/fullchain.pem') }, // ...}).listen(port, host, function() { console.log('Running CORS Anywhere on ' + host + ':' + port);}); |


没有评论:
发表评论