Good day! I have this question. There is an application started by nginx and wsgi, it generates an html page where in the header

<script src="http://localhost/js/OpenLayers/OpenLayers.js"></script> <script src="http://localhost/map.js"></script> <link rel="stylesheet" type="text/css" href="http://localhost/static/css/main.css" /> 

In the nginx config location / {root / home / user / server; uwsgi_pass 127.0.0.1:3031; #uwsgi_pass unix: /// var / run / uwsgi / app / geoserv / socket; include uwsgi_params; ............}

 location ~* .+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov) { expires 30d;} 

The problem is that the page is generated, but css and js are not loaded. Tell me, please, what is the problem, thanks in advance!

  • What server will respond to localhost / js / OpenLayers / OpenLayers.js ? - pyatak
  • [error] 1000 # 0: * 1 open () "/etc/nginx/html/js/OpenLayers/OpenLayers.js" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request : "GET / js/OpenLayers/OpenLayers.js HTTP / 1.1", host: "localhost" - Rumato
  • That is something like this in the logs. Generally 404 Not Found - Rumato
  • Thanks, earned, in the examples there were no ways, but he did not realize. - Rumato

1 answer 1

Well, put in the config directory (root dir), where you have js files, for such a location, you are clearly written that the file /etc/nginx/html/js/OpenLayers/OpenLayers.js is not found, I give 100 guldon that lies in a completely different place.