I'm trying to create a proxy that would load images from remote sites. The reason for this is to enable secure content to be loaded on our end even though the URLs are unsecured (which breaks our SSL badge).
Basically, if I request https://proxy.app.com/?url=http://www.google.lt/images/nav_logo242_hr.png
It would send the image via secure connection back to our users.
So far I've come up with:
server {
listen 80;
listen 443 ssl;
server_name proxy.app.com;
charset utf-8;
location /?url=(.*) {
proxy_pass $1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
...
}
But it returns the default Nginx page. What am I doing wrong? Is this at all possible? I don't want to use a server side language for this.