Nginx. Tips

sayHello

location /sayHello {		  
  add_header Content-Type text/html;

  return 200 '<html><body>hello, there</body></html>';		  
}

How to kill nginx

killNginx.bat

@taskkill /f /im nginx.exe

restartNginx.bat

@taskkill /f /im nginx.exe
C:\Distr\nginx-1.20.2-impex\nginx

How to return file

        location / {
            root   html;
            index  index.html index.htm;
        }
		
        location /test {
            try_files $uri /test.json;            
        }	

put test.json near nginx.exe in html folder

This entry was posted in Без рубрики. Bookmark the permalink.