I'm a newbie on React.js.
I'm trying to deploy a React.js website to a cPanel Server which doesn't have Node.js support. So I'm using these steps:
npm run-script build
build
folder content to server's public_html
via git-ftp
CPanel has free SSL. I've used it so much times with PHP.
I can access to my website with http://example.com
. But when I try to access to https://example.com
, it returns ERR_HTTP2_PROTOCOL_ERROR
.
Here is my package.json file:
{
"name": "example",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"@material-ui/styles": "^4.10.0",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"axios": "^0.19.2",
"bootstrap": "^4.5.0",
"fetch": "^1.1.0",
"history": "^5.0.0",
"react": "^16.13.1",
"react-bootstrap": "^1.3.0",
"react-dom": "^16.13.1",
"react-helmet": "^6.1.0",
"react-notifications-component": "^2.4.0",
"react-owl-carousel2": "^0.3.0",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1",
"react-toast-notifications": "^2.4.0",
"uuid": "^8.2.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [">0.2%", "not dead", "not op_mini all"],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"homepage": "."
}
How can I set the HTTPS protocol and make the page work?
you can install it in your ssl/tls section on cppanel (and this worked for me)
you can use free ssl sites like
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.