【问题标题】:How to add other website in Digitalocean?如何在 Digitalocean 中添加其他网站?
【发布时间】:2014-09-29 16:36:54
【问题描述】:

我想在 Digitalocean 中添加我的投资组合网站,但我不能(服务器运行的是 Ubuntu)。

在 SSH 终端中:

$ var/www/ghost/

http://firstziiz.com -> 这是 Ghost 博客


我将我的网站文件夹推送到 /www

$ var/www/portfolio/

http://firstziiz.com/portfolio -> 不是我的投资组合,而是 404 Error T_T


我应该怎么做才能让它工作?

【问题讨论】:

  • 我混合了不同的教程并更新它们以找到解决方案。如果您想在一个 Droplet 中为多个 Ghost 博客提供服务,我会写一篇结合所有信息的文章。 Install multiple Ghost CMS on DigitalOcean

标签: ubuntu digital-ocean ghost-blog


【解决方案1】:

您如何为 Ghost 博客服务?最常见的方法是使用 Nginx 反向代理。假设您正在做的事情,您应该能够使用an alias directive. 为静态网站提供服务,您的 Nginx 配置应该如下所示:

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/;
    }

}

【讨论】:

    猜你喜欢
    • 2018-08-07
    • 2023-03-31
    • 2019-04-18
    • 1970-01-01
    • 2017-11-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-13
    相关资源
    最近更新 更多