Ghost v. 3.31
Was installed using CLI on Ubuntu 18 with the instructions in the Ghost docs.
This question is rather unrelated to Ghost and has to do mainly with how Ghost configures Nginx, hoping someone can lend a hand. I am trying to have a single subdirectory within Ghost point to another directory on my folder. For example:
- mysite dot com -> points to Ghost as expected
- mysite dot com/article -> points to an article on Ghost as expected
- mysite dot com/specialdirectory -> points to /var/www/specialdirectory and is not handled by Ghost
Unless there is another Nginx file or setting I’m not aware of, this is the configuration:
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;
}
I’m simply not sure what to do. Most tutorials on Nginx indicate that I should be creating a new location block and defining a different value for root, but that hasn’t worked for me. I see that the “/” location block does not even use root but instead proxy_pass to the port that Ghost listens to. How can I create an exception that redirects mysite dot com/specialfolder to my folder instead of being handled by Ghost?