Search code examples
ubuntudigital-oceanghost-blog

How to add other website in Digitalocean?


I would like to add my portfolio website in Digitalocean, but I can't (the server is running Ubuntu).

In the SSH terminal:

$ var/www/ghost/

http://firstziiz.com -> this is Ghost blog


I push my website folder in /www

$ var/www/portfolio/

http://firstziiz.com/portfolio -> don't my portfolio but 404 Error T_T


What should I do to get this working?


Solution

  • How are you serving the Ghost blog? The most common method is to use an Nginx reverse proxy. Assuming that what you are doing, you should be able to serve a static website by using an alias directive. Your Nginx configuration should look something like:

    server {
        listen 80 default_server;
        server_name firstziiz.com;
    
        root /usr/share/nginx/html;
        index index.html index.htm;
    
        client_max_body_size 10G;
    
        location / {
            proxy_pass http://localhost:2368;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_buffering off;
        }
    
        location /portfolio/ {
            alias /var/www/portfolio/;
        }
    
    }