User Tools

Site Tools


servers:windows:nginx_php_php-cgi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
servers:windows:nginx_php_php-cgi [2025/03/14 19:48] – PHP 8.4.5 Sean Rhoneservers:windows:nginx_php_php-cgi [2025/06/24 15:44] (current) – nginx 1.29.0 Sean Rhone
Line 7: Line 7:
 ===== Prerequisites ===== ===== Prerequisites =====
  
-  * [[windows;11_ltsc|Windows 11 (24H2)]]+  * [[windows;11_ltsc_server|Windows 11 (24H2)]]
  
 ====== Install ====== ====== Install ======
Line 14: Line 14:
  
   * https://nginx.org/en/download.html   * https://nginx.org/en/download.html
-  * Last tested: ''nginx-1.27.4.zip''+  * Last tested: ''nginx-1.29.0.zip''
  
-  * Extract to root system drive for ''C:\nginx-1.27.4\nginx.exe''+  * Extract to root system drive for ''C:\nginx-1.29.0\nginx.exe''
  
   explorer "%SystemDrive%"   explorer "%SystemDrive%"
  
   CD "%SystemDrive%\nginx-"*"\" && "nginx.exe" -v   CD "%SystemDrive%\nginx-"*"\" && "nginx.exe" -v
 +
 +==== confs ====
 +
 +  MKDIR "%SystemDrive%\www\nginx\conf"
 +
 +  COPY /Y "%SystemDrive%\nginx-1.29.0\conf\fastcgi_params" "%SystemDrive%\www\nginx\conf"
 +
 +  COPY /Y "%SystemDrive%\nginx-1.29.0\conf\mime.types" "%SystemDrive%\www\nginx\conf"
 +
 +==== Firewall ====
 +
 +  "netsh.exe" advfirewall firewall add rule name="nginx" dir="in" action="allow" profile="any" program="%SystemDrive%\nginx-1.29.0\nginx.exe" protocol="tcp" localport="80,443"
 +
 +  "netsh.exe" advfirewall firewall delete rule name="nginx"
  
 ===== PHP-CGI ===== ===== PHP-CGI =====
Line 27: Line 41:
  
   * https://windows.php.net/download/   * https://windows.php.net/download/
 +  * https://windows.php.net/qa/
   * x64 Non Thread Safe   * x64 Non Thread Safe
-  * Last tested: ''php-8.4.5-nts-Win32-vs17-x64.zip''+  * Last tested: ''php-8.4.9RC1-nts-Win32-vs17-x64.zip''
  
-  * Extract to root system drive for ''C:\php-8.4.5-nts-Win32-vs17-x64\php-cgi.exe''+  * Extract to root system drive for ''C:\php-8.4.9RC1-nts-Win32-vs17-x64\php-cgi.exe''
   * Add to user ''Path''   * Add to user ''Path''
  
Line 39: Line 54:
   "SystemPropertiesAdvanced.exe"   "SystemPropertiesAdvanced.exe"
  
-  C:\php-8.4.5-nts-Win32-vs17-x64 +  C:\php-8.4.9RC1-nts-Win32-vs17-x64
- +
-====== Firewall ====== +
- +
-  * 80/tcp is HTTP +
-  * 443/tcp is HTTPS +
- +
-  netsh advfirewall firewall add rule name="nginx HTTP" dir="in" action="allow" protocol="TCP" localport="80" +
- +
-  netsh advfirewall firewall add rule name="nginx HTTPS" dir="in" action="allow" protocol="TCP" localport="443"+
  
 ====== nginx Settings ====== ====== nginx Settings ======
Line 61: Line 67:
  
   MKDIR "%SystemDrive%\www\nginx\vhosts.d"   MKDIR "%SystemDrive%\www\nginx\vhosts.d"
- 
-  explorer "%SystemDrive%\www" 
  
 ===== HTTPS Redirect ===== ===== HTTPS Redirect =====
Line 116: Line 120:
  
 ===== nginx ===== ===== nginx =====
- 
-  * :!: ''mime.types'' include hard-coded to nginx version path 
-  * TODO: Copy all hard-coded files to ''www'' instead 
  
   notepad "%SystemDrive%\www\nginx\nginx.conf"   notepad "%SystemDrive%\www\nginx\nginx.conf"
Line 145: Line 146:
     include C:/www/nginx/conf.d/*.conf;     include C:/www/nginx/conf.d/*.conf;
     include C:/www/nginx/vhosts.d/*.conf;     include C:/www/nginx/vhosts.d/*.conf;
-    include C:/nginx-1.27.4/conf/mime.types;+    include C:/www/nginx/conf/mime.types;
     default_type application/octet-stream;     default_type application/octet-stream;
  
Line 162: Line 163:
     gzip_comp_level 9;     gzip_comp_level 9;
     gzip_types *;     gzip_types *;
-}</code>+    gzip_static always; 
 +    gunzip on; 
 +} 
 + 
 +# End</code>
  
 ==== CSP Headers ==== ==== CSP Headers ====
Line 180: Line 185:
 ==== Settings ==== ==== Settings ====
  
-  notepad "%SystemDrive%\www\nginx\conf.d\ssl.conf"+  "notepad.exe" "%SystemDrive%\www\nginx\conf.d\ssl.conf"
  
 <code> <code>
-ssl_certificate "C:/Certbot/live/realmofespionage.xyz/fullchain.pem"; +ssl_certificate "C:/www/certbot/certs/fullchain1.pem"; 
-ssl_trusted_certificate "C:/Certbot/live/realmofespionage.xyz/fullchain.pem"; +ssl_trusted_certificate "C:/www/certbot/certs/fullchain1.pem"; 
-ssl_certificate_key "C:/Certbot/live/realmofespionage.xyz/privkey.pem";+ssl_certificate_key "C:/www/certbot/certs/privkey1.pem";
  
 ssl_session_timeout "10m"; ssl_session_timeout "10m";
Line 196: Line 201:
 ssl_prefer_server_ciphers "on"; ssl_prefer_server_ciphers "on";
 ssl_ecdh_curve "secp384r1"; ssl_ecdh_curve "secp384r1";
- 
-ssl_stapling "on"; 
-ssl_stapling_verify "on"; 
-resolver "1.1.1.2" "1.0.0.2" "[2606:4700:4700::1112]" "[2606:4700:4700::1002]" "valid=300s"; 
-resolver_timeout "5s"; 
  
 # End</code> # End</code>
  
 ====== Scripts ====== ====== Scripts ======
 +
 +****
  
   MKDIR "%SystemDrive%\www\scripts\nginx"   MKDIR "%SystemDrive%\www\scripts\nginx"
- 
-  explorer "%SystemDrive%\www\scripts\nginx" 
  
 ===== Start ===== ===== Start =====
  
-  notepad "%SystemDrive%\www\scripts\nginx\Start.bat"+  "notepad.exe" "%SystemDrive%\www\scripts\nginx\Start.bat"
  
 <code> <code>
Line 219: Line 219:
  
 :: End</code> :: End</code>
- 
-==== Autostart ==== 
- 
-  explorer "%AppData%\Microsoft\Windows\Start Menu\Programs\StartUp" 
- 
-  "%SystemDrive%\www\scripts\nginx\Start.bat" 
- 
-  nginx 
  
 ===== Stop ===== ===== Stop =====
  
-  notepad "%SystemDrive%\www\scripts\nginx\Stop.bat"+  "notepad.exe" "%SystemDrive%\www\scripts\nginx\Stop.bat"
  
 <code> <code>
Line 237: Line 229:
  
 :: End</code> :: End</code>
 +
 +  "%SystemDrive%\www\scripts\nginx\Stop.bat"
  
 ===== Reload ===== ===== Reload =====
  
-  notepad "%SystemDrive%\www\scripts\nginx\Reload.bat"+  "notepad.exe" "%SystemDrive%\www\scripts\nginx\Reload.bat"
  
 <code> <code>
Line 248: Line 242:
  
 :: End</code> :: End</code>
 +
 +  "%SystemDrive%\www\scripts\nginx\Reload.bat"
 +
 +====== Shortcuts ======
 +
 +===== Desktop =====
 +
 +==== Start ====
 +
 +  "%SystemDrive%\www\scripts\nginx\Start.bat"
 +
 +  nginx Start
 +
 +==== Stop ====
 +
 +  "%SystemDrive%\www\scripts\nginx\Stop.bat"
 +
 +  nginx Stop
 +
 +==== Autostart ====
 +
 +  "explorer.exe" "%AppData%\Microsoft\Windows\Start Menu\Programs\StartUp"
 +
 +  "%SystemDrive%\www\scripts\nginx\Start.bat"
 +
 +  nginx
 +
  
 ====== TODOs ====== ====== TODOs ======
Line 258: Line 279:
   * https://community.letsencrypt.org/t/using-certbot-in-windows-the-pragmatic-way/173929   * https://community.letsencrypt.org/t/using-certbot-in-windows-the-pragmatic-way/173929
   * https://www.php.net/manual/en/image.installation.php   * https://www.php.net/manual/en/image.installation.php
 +  * [[https://www.ssllabs.com/ssltest/analyze.html?d=wiki.realmofespionage.xyz|Qualys SSL Test]]
  
C:/www/wiki/data/attic/servers/windows/nginx_php_php-cgi.1741996124.txt.gz · Last modified: by Sean Rhone