Help for nginx proxy pass rule

Anoop Alias anoopalias01 at gmail.com
Wed Apr 6 13:21:26 UTC 2016


Are you sure the location is working?

abc.com/static/js/widget.js" failed (2: No such file or directory) - I
think its trying to access that file locally and not via the proxy

On Wed, Apr 6, 2016 at 4:14 PM, Roni Baby <roni at citrusinformatics.com> wrote:
> HI,
>
>
>
> We have a WordPress site named it as https://www.abc.com; We are using Nginx
> as the web server for this site. I wanted to create a proxy pass rule like
> this
>
>
>
> https://www.abc.com/static/js/widget.js will be load from
> https://www.xys.org/static/js/widget.js without changing URL
>
>
>
> Here is the configuration that I configured for this requirement in the
> www.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 Nginx
> 404 Not Found error with the following error log in its log file
>
> 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: www.abc.com
>
> I have tried different Nginx proxy pass configuration but not success yet.
> It will be good to get your thought to fix this issues
>
> Thanks
>
> Roni
>
>
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx



-- 
Anoop P Alias



More information about the nginx mailing list