I'm unable to find how I can map a single URL to a single static file. I tried:
location /feeds/seznam/ {
alias /path/to/file/feed.xml;
}
but this does not work (in logs I see that it appends index.html to the path).
I'm unable to find how I can map a single URL to a single static file. I tried:
location /feeds/seznam/ {
alias /path/to/file/feed.xml;
}
but this does not work (in logs I see that it appends index.html to the path).
Try this instead:
location /feeds/seznam/ {
rewrite ^/feeds/seznam/$ /path/to/file/feed.xml;
}
alias /your-file-path; -- https://nginx.org/en/docs/http/ngx_http_core_module.html#alias
– jobwat
Feb 07 '17 at 00:51