'Nuxt running on port domain.com:49000, how could I run it on domain.com
I am using nuxt js to host on a vps.
My package.json looks like this:
{
"name": "nuxtjs",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "nuxt --hostname example.com --port 49000",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"deploy": "pm2 start npm --name nuxtjs -- start"
},
"dependencies": {
"@nuxtjs/axios": "^5.13.6",
"@yeger/vue-masonry-wall": "^3.0.16",
"core-js": "^3.19.3",
"nuxt": "^2.15.8",
"pm2": "^5.1.2",
"vue": "^2.6.14",
"vue-server-renderer": "^2.6.14",
"vue-template-compiler": "^2.6.14",
"webpack": "^4.46.0"
},
"devDependencies": {},
"config":{
"nuxt":{
"host": "0.0.0.0",
"port": "49000"
}
}
}
And I run the script: npm run deploy. This start the server on example.com:49000, now instead of running on this port how could I run it on example.com.
I have tried to add .htaccess as:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^index.php(.*) http://example.com:49000/$1 [P,L]
RewriteRule (.*) http://example.com:49000/$1 [P,L]
but it gives me error on http://example.com as:
Not Found
The requested URL was not found on this server.
Apache/2.4.41 (Ubuntu) Server at example.com Port 80
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
