<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Kartika;
        panose-1:2 2 5 3 3 4 4 6 2 3;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
h1
        {mso-style-priority:9;
        mso-style-link:"Heading 1 Char";
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:24.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.Heading1Char
        {mso-style-name:"Heading 1 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 1";
        font-family:"Times New Roman","serif";
        font-weight:bold;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-IN link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>HI,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>We have a WordPress site named it as <a href="https://www.abc.com">https://www.abc.com</a>; We are using Nginx as the web server for this site. I wanted to create a proxy pass rule like this<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><a href="https://www.abc.com/static/js/widget.js">https://www.abc.com/static/js/widget.js</a> will be load from <a href="https://www.xys.org/static/js/widget.js">https://www.xys.org/static/js/widget.js</a> without changing URL<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Here is the configuration that I configured for this requirement in the <a href="http://www.abc.com">www.abc.com</a> Nginx site configuration file<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>location /static {<o:p></o:p></p><p class=MsoNormal>        proxy_pass      https://www.xys.org/static;<o:p></o:p></p><p class=MsoNormal>        proxy_set_header Host  www.xys.org;<o:p></o:p></p><p class=MsoNormal>        proxy_set_header X-Real-IP $remote_addr;<o:p></o:p></p><p class=MsoNormal>        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<o:p></o:p></p><p class=MsoNormal>        proxy_set_header X-Forwarded-Proto $scheme;<o:p></o:p></p><p class=MsoNormal>}<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><h1><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";font-weight:normal'>When I access <span class=MsoHyperlink><a href="https://www.abc.com/static/js/widget.js">https://www.abc.com/static/js/widget.js</a>,</span>  I am getting Nginx 404 Not Found error with the following error log in its log file<o:p></o:p></span></h1><h1><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";font-weight:normal'>2016/04/06 06:39:14 [error] 20107#0: *907 open() "/usr/share/nginx/html/www.abc.com/static/js/widget.js" failed (2: No such file or directory), client: 118.102.223.138, server: www.abc.com, request: "GET /static/js/widget.js HTTP/1.1", host: <a href="http://www.abc.com">www.abc.com</a><o:p></o:p></span></h1><h1><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";font-weight:normal'>I have tried different Nginx proxy pass configuration but not success yet. It will be good to get your thought to fix this issues<o:p></o:p></span></h1><h1><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";font-weight:normal'>Thanks<o:p></o:p></span></h1><h1><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";font-weight:normal'>Roni<o:p></o:p></span></h1><p class=MsoNormal><o:p> </o:p></p></div></body></html>