Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

Expires - External files

$
0
0
I needed a solution to set expires in external files, because in some sites check the loading time of the web page where brought urls as external source, without css expires and thus lowering the score. Checking the internet I found something, some forms having to compile nginx with modules not so well known, preferred to try it another way.

Then I had the following idea of ​​creating a vhost where there the following lines:

server {

         listen 80;

         server_name proxy.domain.com;

         location / {file.js

                 proxy_pass http://externaldomain.com/file.js;
                 expires 30d;

         }

}

What do you think?

Had another way to do?

I hope I helped some people like me who could not otherwise.

Sorry for my English.

Viewing all articles
Browse latest Browse all 53287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>