Advertisement
thesuhu

Nginx Windows

Feb 23rd, 2020
526
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.69 KB | None | 0 0
  1. # download for windows http://nginx.org/en/download.html
  2.  
  3. # ubah konfigurasi nginx.conf
  4.     server {
  5.         listen       8181;
  6.         server_name  localhost;
  7.         #charset koi8-r;
  8.         #access_log  logs/host.access.log  main;
  9.         location / {
  10.             root   "d:\www";
  11.             index  index.html index.htm;
  12.         }
  13.  
  14. # restart nginx windows, bikin file bat berikut
  15. @ECHO OFF
  16. cd C:\Portable\nginx-1.16.1
  17. taskkill /f /IM nginx.exe
  18. start nginx.exe
  19. pause
  20.  
  21. # menyambungkan ke php
  22. # install php tambahkan ke path, kemudian jalankan php-cgi
  23. C:\php-7.3.14\php-cgi.exe -b 127.0.0.1:9000
  24. # jika ingin dijalan secara hide, bisa menggunakan RunHiddenConsole, bikin file bat dengan script berikut
  25. ECHO Starting PHP FastCGI...
  26. set PATH=C:\php-7.3.14;%PATH%
  27. C:\Portable\RunHiddenConsole\RunHiddenConsole.exe C:\php-7.3.14\php-cgi.exe -b 127.0.0.1:9000
  28.  
  29. # agar bisa interface php, dokumentasi di sini https://www.nginx.com/resources/wiki/start/topics/examples/phpfastcgionwindows/
  30. # contoh deploy laravel di sini https://github.com/ajarkoding/nginx-laravel-windows
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement