HI,
We have a WordPress site named it as https://www.abc.com ; We are using
https://www.abc.com/static/js/widget.js  will be load fromhttps://www.xys.org/static/js/widget.js  without changing URL
Here is the configuration that I configured for this requirement in thewww.abc.com  Nginx site configuration file
location /static {
    proxy_pass      https://www.xys.org/static;
    proxy_set_header Host  www.xys.org;
    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;
}
When I access https://www.abc.com/static/js/widget.js ,  I am getting
2016/04/06 06:39:14 [error] 20107#0: *907 open()www.abc.com ,www.abc.com 
I have tried different Nginx proxy pass configuration but not success
Thanks
Roni
             
            
              
            
                
           
          
            
              
                Roni_B  
              
                  
                    April 6, 2016,  3:21pm
                   
                  2 
               
             
            
              Are you sure the location is working?
abc.com/static/js/widget.js " failed (2: No such file or directory) - I
On Wed, Apr 6, 2016 at 4:14 PM, Roni B. [email protected] 
https://www.abc.com/static/js/widget.js  will be load from
}
nginx mailing list[email protected] nginx Info Page 
 
–
             
            
              
            
                
           
          
            
              
                Roni_B  
              
                  
                    April 6, 2016,  3:28pm
                   
                  3 
               
             
            
              Yes the destination URl [https://www.xys.org/static/js/widget.js ] is
Thanks for your reply
             
            
              
            
                
           
          
            
              
                Roni_B  
              
                  
                    April 6, 2016, 11:47pm
                   
                  4 
               
             
            
              On Wed, Apr 06, 2016 at 06:58:07PM +0530, Roni B. wrote:
Hi there,
Yes the destination URl [https://www.xys.org/static/js/widget.js ] is working
 
Read Module ngx_http_core_module 
Then do something like
grep location your.conf
to see which location{} blocks you have defined.
Which one of those locations will nginx use to handle this request?
The error log suggests that this request is handled in a location that
location ~ js$ {
Possibly changing your
location /static {
 
to
location ^~ /static {
will make it work the way you want. That would tell nginx to choose it
Separate from that: for the proxy_pass directive, you could probably
But until the proxy_pass is actually used, changing it will make no
 
Francis D.        [email protected] 
             
            
              
            
                
           
          
            
              
                Roni_B  
              
                  
                    April 7, 2016,  6:20am
                   
                  5 
               
             
            
              Perfect fix… Able to solve my issues.Thanks Francis
The issue was, I configured these location blocks already in my config
location ~* ^.+.(jpg|jpeg|gif|css|png|ico|zip|xspf|swf|ttf|woff|js)$ {
It was over ride the location rule that I used
It started to work my location rule changed it like this as per your
location ^~ /static {
Thanks a Lot