Tuesday, 19 February 2019

Deploy node js express application - cent os

I am trying to deploy a node js application on GoDaddy VPS hosting.

I have uploaded all the files to the server and started the server using pm2 following This Tutorial

My server is running on port 3021 which I want to run on port 80 for a particular domain.

I have completed steps till pm2 in the tutorial but from Nginx part, I cannot understand what to do next.

I have installed Nginx then running this command sudo vi /etc/nginx/sites-available/default

and adding configurations and when I am saving it an error shows [ Error writing /etc/nginx/sites-available/default: No such file or directory ]

I am running apache in the server. Is it possible to do the same using apache??

Edit

Here is my nginx config::

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;


include /usr/share/nginx/modules/*.conf;

events {
    worker_connections  1024;
}


http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;


    include /etc/nginx/conf.d/*.conf;
}



from Deploy node js express application - cent os

No comments:

Post a Comment