There is a local site, mycompany.ru and there is an external resource, domain.ru

It is necessary that the domain.ru/ site be uploaded to mycompany.ru/folder/

Made:

location /folder/ { proxy_pass http://domain.ru/ } 

As a result, the content is loaded, but the statics falls with a 404 error, because The site source is written relative to the root.

As a result, we obtain:

 http://mycompany.ru/js/jquery.js - 404 http://mycompany.ru/css/style.css - 404 

etc.

I ask you to tell in which direction to dig .. Googled, read mana, but apparently I don’t understand something ...

  • http://mycompany.ru/js/jquery.js should also be taken from domain.ru or not? - MANK
  • Thanks for ngx_http_sub_module, I saw this module, but I really don't want to rebuild nginx :( - Pum Purum
  • @ MAN69K all statics available on domain.ru - Pum Purum
  • @PumPurum: then why are you redirecting there only requests to /folder/ ? - MANK

0