According to @AlexanderStaroselsky, deploying a nuxt app to shared hosting may not be successful due to the inability to run a reverse proxy after deployment. I attempted this on Godaddy shared hosting and it turned into a complete disaster.
After gaining shell access, installing node, transferring files, running npm run build
, and npm start
, everything seemed to be going smoothly until the issue arose of directing traffic to the nuxt app. Unlike traditional methods using .htaccess to direct to index.php or index.html, redirecting to http://localhost:3000 through a rewrite rule caused malfunctions within the app. Despite making the app visible, key functionalities such as routing didn't work, images linked with require('~/assets/images/...')
wouldn't display, rendering the entire setup unworkable.
The solution lies in being able to install nginx for setting up a reverse proxy, which is not feasible on shared hosting platforms that do not provide root privileges for such installations. Cloud hosting providers offer virtual servers with full root access, allowing you to install nginx, node, and other necessary packages. Popular and affordable options include digitalocean, AWS, Google Cloud, UpCloud, among others.
Deploying a nuxt app can be complex, especially when incorporating a rest api and obtaining an SSL certificate. However, detailed documentation exists to guide you through these processes.
In the rare case that someone manages to successfully deploy a nuxt app on shared hosting, please share your method so I can make use of my neglected Godaddy account, for which I paid several years' worth but no longer utilize.