我想在Digitalocean中添加我的投资组合网站,但我不能(服务器正在运行Ubuntu)。
在SSH终端中:
$ var/www/ghost/
http://firstziiz.com - >这是Ghost博客
我在/ www
中推送我的网站文件夹$ var/www/portfolio/
http://firstziiz.com/portfolio - >不是我的投资组合,而是404错误T_T
我该怎么做才能让它发挥作用?
答案 0 :(得分:0)
你是如何为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/;
}
}