I hope this is going to be a relatively simple one but I'm stumped and searching through potential solutions haven't helped.
I am looking to serve a static (ads.txt) file for my Ghost droplet on DigitalOcean. But there is a problem, as it doesn't seem to be reachable on https/ssl whereas on http it's fine?
More specifically, on my domain example.com,
https://example.com/ads.txt
gives a 404, while http://example.com/ads.txt
works just fine
Why would that be, and how do I fix it?
Here are my .conf files:
.conf
file
server {
listen 80;
listen [::]:80;
server_name XXX;
root /var/www/ghost/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;
}
location /ads.txt {
alias /var/www/ads.txt;
}
client_max_body_size 50m;
}
-ssl.conf
file
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name XXX;
root /var/www/ghost/system/nginx-root; # Used for acme.sh SSL verification (https://acme.sh)
ssl_certificate /etc/letsencrypt/XXX/fullchain.cer;
ssl_certificate_key /etc/letsencrypt/XXX/XXX.key;
include /etc/nginx/snippets/ssl-params.conf;
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;
}
location /ads.txt {
alias /var/www/ads.txt;
}
client_max_body_size 50m;
}
I've tried a bunch of variations for the ssl conf file but to no avail. Any help would be much appreciated!