I have create a new stack where Nginx server act as a reverse proxy between a CDN server and the browser, and the Nginx server supposed to resolve SSIs of all the HTML files from the CDN. The issue is Nginx server resolves only Content-type:text/html type files not application/octet-stream (even though all of them are actual .html files despite the content-type, it is a glitch on our company's CDN)
location /path/ {
ssi on;
add_header Content-Type text/html;
proxy_pass https://example-cdn.com/path/;
}
Is there a way to force Nginx to resolve any file as long as the extension is .html despite the Content-type header in the CDN response?
I created a secondary server in the same config, rewriting the Content-Type based on the extension and consuming the content for the primary nginx server from there.
Secondary server in the same config
Primary server
still open for a more efficient solution.