ArmandoF ArmandoF - 1 month ago 6
Linux Question

Nginx imagenlocal imagenremote

I have the following problem. On a server where I installed Nginx I need to donwload, or at least I need that Nginx download/show an image contained in http://www.hamqsl.com/solarbc.php. So I do the following:

location /solarbc {

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://www.hamqsl.com/solarbc.php;
proxy_read_timeout 90;
proxy_redirect http://www.hamqsl.com/solarbc.php https://server/solarbc;

}


So when people on my network visit https://server/solarbc get the image. I tried this and it does not work, any suggestions?

I´m downloading the image and serving it with Nginx but could be more nicer if Nginx do the trick without a console script involved...

Answer

Con la ayuda de un amigo ya me funciona el proxy inverso de la imagen

   location /solarbc {
    add_header X-Proxy-Cache $upstream_cache_status;
      proxy_redirect      off;
      proxy_set_header        Host www.hamqsl.com;
      proxy_set_header        X-Forwarded-Server $host;
      proxy_set_header        X-Real-IP $remote_addr;
      proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header        X-Forwarded-Proto http;
      proxy_pass          http://www.hamqsl.com/solarbc.php;
    }