aizu's Knowledge Base
    • Go to: aizu.my Homepage
    • Recent
    • Tags
    • Register
    • Login

    New server prep - Ubuntu 20.24 LTS - Nodejs 18

    Linux
    1
    3
    114
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      aizu
      last edited by aizu

      # apt-get update
      # apt-get upgrade
      
      # curl -sL https://deb.nodesource.com/setup_22.x -o /tmp/nodesource_setup.sh
      # sh /tmp/nodesource_setup.sh
      # apt-get install nodejs
      

      Ref: https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-20-04

      1 Reply Last reply Reply Quote 0
      • A
        aizu
        last edited by aizu

        server {
                listen 80;
                server_name localhost;
        
                root /var/www/html/domain.com/source/static/;
        	index index.html;
        
                location / {
                        proxy_pass http://127.0.0.1:3000;
                        proxy_set_header Upgrade $http_upgrade;
                        proxy_set_header Connection 'upgrade';
                        proxy_set_header Host $host;
                        proxy_cache_bypass $http_upgrade;
                        proxy_read_timeout 600s;
                }
        
        	location /static {
        		alias /var/www/html/domain.com/source/static/;
        		index index.html;
        	}
        }
        
        server {
                listen 80;
                server_name static.domain.com;
                root /var/www/html/static.domain.com/;
        	index index.html;
                location / {
                        try_files $uri /index.html =404;
                }
        }
        
        1 Reply Last reply Reply Quote 0
        • A
          aizu
          last edited by

          rewrite ^/(.*)$ https://destination.domain.com/$1 permanent;
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post