😠I found a way and it's working as intended. I am still not sure if it's right method (since I am new to vhost customization and all) but here you go:
I just edited the vhost files for my example.com for port 80 (vhost.conf
) in litespeed folder.
What I changed in the file was a simple line of code:
extprocessor 30000 {
type proxy
address https://127.0.0.1:30000
env NODE_ENV=production
maxConns 5
initTimeout 20
retryTimeout 20
respBuffer 0
}
I just changed the address 127.0.0.1:30000
to address https://127.0.0.1:30000
Now, example.com
is:
https://example.com
without problems, working.https://example.com
without problems, working.https://example.com
is
http://example.com:30000
is
https://example.com:30000
is
this was done with nodejs using:
https.createServer(options, app).listen(30000, ()=>{
console.log("Running at port 30000");
});
and in options:
const options = {
key: fs.readFileSync(path.resolve("example.com.key")),
cert: fs.readFileSync("example.com.crt"),
ca: fs.readFileSync(path.resolve("example.com-ca.crt"))
};
ca file(s) might not be available under your control panel's ssl folder. Mine works even when I omit the ca key-value pair.
P.S. Last night copilot broke my brain after serving me an answer where the code asked http and https to listen to port 30000, and then copilot itself said one port cannot be assigned to two different things. 😠I quit copilot then and there.