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 [2026/01/17 09:34] Sean Rhoneservers:windows:nginx_php_php-cgi [2026/02/25 05:51] (current) – [nginx] Sean Rhone
Line 4: Line 4:
   * PHP ((https://windows.php.net/download/))   * PHP ((https://windows.php.net/download/))
   * PHP-CGI   * PHP-CGI
-  * [[Information:Realm of Espionage]]+  * [[information;realm_of_espionage|Realm of Espionage]]
  
 ===== Prerequisites ===== ===== Prerequisites =====
Line 14: Line 14:
 ===== nginx ===== ===== nginx =====
  
-  * https://nginx.org/en/download.html +  * https://nginx.org/en/download.html ([[https://nginx.org/en/CHANGES|CHANGES]]) 
-  * Last tested: ''nginx-1.29.4.zip''+  * Last tested: ''nginx-1.29.5.zip''
  
-  * Extract to root system drive for ''C:\nginx-1.29.4\nginx.exe''+  * Extract to root system drive for ''C:\nginx-1.29.5\nginx.exe''
  
   "explorer.exe" "%SystemDrive%"   "explorer.exe" "%SystemDrive%"
Line 23: Line 23:
 ===== PHP-CGI ===== ===== PHP-CGI =====
  
-  * https://windows.php.net/download/ +  * https://windows.php.net/download/ ([[https://windows.php.net/downloads/releases/|raw]]) 
-  * https://windows.php.net/qa/+  * https://windows.php.net/qa/ ([[https://windows.php.net/downloads/qa/|raw]])
   * x64 Non Thread Safe   * x64 Non Thread Safe
   * Last tested: ''php-8.5.1-nts-Win32-vs17-x64.zip''   * Last tested: ''php-8.5.1-nts-Win32-vs17-x64.zip''
Line 42: Line 42:
  
   CD "%SystemDrive%\nginx-"*"\" && "netsh.exe" advfirewall firewall add rule name="nginx" dir="in" action="allow" profile="any" program="%CD%\nginx.exe" protocol="tcp" localport="80,443"   CD "%SystemDrive%\nginx-"*"\" && "netsh.exe" advfirewall firewall add rule name="nginx" dir="in" action="allow" profile="any" program="%CD%\nginx.exe" protocol="tcp" localport="80,443"
 +
 +===== Delete Rule =====
 +
 +****
 +
 +  "netsh.exe" advfirewall firewall delete rule name="nginx"
  
 ====== Check Defaults ====== ====== Check Defaults ======
Line 89: Line 95:
 ===== Non-existent 404 ===== ===== Non-existent 404 =====
  
-  * This prevents unconfigured subdomains from loading assets from other sites ((if a site/URL doesn'exist, it'll 404))+  * This prevents unconfigured subdomains from loading assets from other sites ((if a site/URL doesn'have a ''vhosts.d\*.conf'', it'll 404))
  
   "notepad.exe" "%SystemDrive%\www\nginx\conf.d\non-existent.conf"   "notepad.exe" "%SystemDrive%\www\nginx\conf.d\non-existent.conf"
Line 115: Line 121:
 add_header "X-Frame-Options" "sameorigin" "always"; add_header "X-Frame-Options" "sameorigin" "always";
 add_header "X-XSS-Protection" "1; mode=block" "always"; add_header "X-XSS-Protection" "1; mode=block" "always";
-add_header "Cache-Control" "no-store, no-transform, public" "always";+add_header "Cache-Control" "max-age=604800, no-transform, public" "always";
 add_header "Referrer-Policy" "same-origin" "always"; add_header "Referrer-Policy" "same-origin" "always";
 add_header "Expect-CT" "max-age=0" "always"; add_header "Expect-CT" "max-age=0" "always";
Line 209: Line 215:
 @echo off @echo off
  
 +TITLE nginx
 CD "%SystemDrive%\nginx-"*"\" CD "%SystemDrive%\nginx-"*"\"
  
Line 224: Line 231:
 @echo off @echo off
  
 +TITLE nginx Stop
 CD "%SystemDrive%\nginx-"*"\" CD "%SystemDrive%\nginx-"*"\"
  
 "nginx.exe" -s "quit" "nginx.exe" -s "quit"
 +
 +TIMEOUT /T "2" /NOBREAK
 +TASKKILL /IM "nginx.exe" /T /F
 +
 +CD "%Temp%"
  
 :: End</code> :: End</code>
Line 243: Line 256:
 "nginx.exe" -s "reload" "nginx.exe" -s "reload"
 "nginx.exe" -s "reopen" "nginx.exe" -s "reopen"
 +
 +CD "%Temp%"
  
 :: End</code> :: End</code>
Line 250: Line 265:
 ====== Task Scheduler ====== ====== Task Scheduler ======
  
-****+===== nginx ===== 
 + 
 +  Auto-start
  
   SCHTASKS /Create /SC "ONLOGON" /TN "nginx" /TR "%SystemDrive%\www\scripts\nginx\Start.bat" /F   SCHTASKS /Create /SC "ONLOGON" /TN "nginx" /TR "%SystemDrive%\www\scripts\nginx\Start.bat" /F
/usr/local/www/wiki/data/attic/servers/windows/nginx_php_php-cgi.1768660479.txt.gz · Last modified: by Sean Rhone