Ubuntu 使用Ghost,使子目录指向服务器上的另一个目录
我已按照以下说明安装Ghost: 这非常有效,只是我不太了解如何定制NGINX配置。基本上,我想做的是让给定的子目录指向服务器上的另一个目录。例如:Ubuntu 使用Ghost,使子目录指向服务器上的另一个目录,ubuntu,nginx,ghost-blog,Ubuntu,Nginx,Ghost Blog,我已按照以下说明安装Ghost: 这非常有效,只是我不太了解如何定制NGINX配置。基本上,我想做的是让给定的子目录指向服务器上的另一个目录。例如: mysite.com->按预期指向Ghost mysite.com/article->按预期指向有关Ghost的文章 mysite.com/specialdirectory->指向/var/www/specialdirectory,不由Ghost处理 除非有另一个我不知道的NGINX文件或设置,否则这是配置: server { list
- mysite.com->按预期指向Ghost
- mysite.com/article->按预期指向有关Ghost的文章
- mysite.com/specialdirectory->指向/var/www/specialdirectory,不由Ghost处理
server {
listen 80;
listen [::]:80;
server_name mysite;
root /var/www/mysite/system/nginx-root; # Used for acme.sh SSL verification (https://acme.sh)
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:2368;
}
location ~ /.well-known {
allow all;
}
client_max_body_size 50m;
}
我只是不知道该怎么办。NGINX上的大多数教程都指出,我应该创建一个新的位置块,并为root定义一个不同的值,但这对我来说并不奏效。我看到“/”位置块甚至不使用root,而是将proxy_传递给Ghost侦听的端口。如何创建将mysite.com/specialfolder重定向到我的文件夹而不是由Ghost处理的异常