Carlos Pisarello
Carlos Pisarello

Reputation: 1284

Deploy a universal APP made with Nuxtjs on apache shared hosting

I just finished a universal app developed with Nuxtjs and want to deploy it on the server of the company where i work. I have to say that i'm pretty newbie with server things, so i'm kinda lost here.

The specs of the server are the following:

enter image description here

Most of the tutorials talk about proxying with Nginx, that's what i did first, but to do so i killed the apache server that was using que port 80 (I didn't know i was doing that), so i mounted the apache server again and gave up with nginx.

Then i found an .htaccess file on the web and tryed it out, the file had the following code:

.htaccess

RewriteEngine on
 
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

DirectoryIndex index.html

RewriteRule ^$ http://127.0.0.1:3000/ [P,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://127.0.0.1:3000/$1 [P,L]

It didn't work at all

Then i tryed writing the next two lines on the httpd.conf file of the apache (I found them two on another tutorial).

ProxyPass "https://appdomain.tk" "http://localhost:3000"
ProxyPassReverse "https://appdomain.tk" "http://localhost:3000" 

They didn't work either. I'm loosing my mind. I have the ssl certificate configured for the domain, and a free domain .tk

Is there actually a way to deploy a universal Nuxt.js app on an apache shared hosting?

Upvotes: 4

Views: 5772

Answers (1)

JanuszO
JanuszO

Reputation: 1240

I make something like this:

DocumentRoot "/var/www/YOUR_DIR"
ServerName domain.com
ServerAlias www.domain.com

ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/

of course you should also run in apache proxy. If you do not have it enabled, execute the command:

sudo a2enmod proxy_http
sudo a2enmod proxy

and restart apache, run node app.

Upvotes: 7

Related Questions