servers:windows:nginx_php_php-cgi
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| servers:windows:nginx_php_php-cgi [2025/01/07 00:14] – Sean Rhone | servers:windows:nginx_php_php-cgi [2026/04/15 09:45] (current) – [Firewall] Sean Rhone | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| * nginx ((https:// | * nginx ((https:// | ||
| - | * PHP + PHP-CGI((https:// | + | * PHP ((https:// |
| - | * [[Information: | + | * PHP-CGI |
| + | * [[information; | ||
| ===== Prerequisites ===== | ===== Prerequisites ===== | ||
| - | * [[windows:10|Windows 10]] | + | * [[windows; |
| ====== Install ====== | ====== Install ====== | ||
| Line 13: | Line 14: | ||
| ===== nginx ===== | ===== nginx ===== | ||
| - | * https:// | + | * https:// |
| - | * Last tested: '' | + | * Last tested: '' |
| - | * Extract to root system drive for '' | + | * Extract to root system drive for '' |
| - | | + | "%SystemRoot%\explorer.exe" " |
| - | + | ||
| - | CD " | + | |
| ===== PHP-CGI ===== | ===== PHP-CGI ===== | ||
| - | * https://windows.php.net/download/ | + | * https://www.php.net/downloads.php |
| + | * https:// | ||
| * x64 Non Thread Safe | * x64 Non Thread Safe | ||
| - | * Last tested: '' | + | * Last tested: '' |
| - | * Extract to root system drive for '' | + | * Extract to root system drive for '' |
| + | * Add to user '' | ||
| - | | + | "%SystemRoot%\explorer.exe" "%SystemDrive%" |
| - | | + | "%SystemRoot%\System32\SystemPropertiesAdvanced.exe" |
| - | | + | |
| - | < | + | ====== Firewall ====== |
| - | ===== PHP Extensions ===== | + | CD " |
| - | ==== Verify Modules ==== | + | " |
| - | CD " | + | ===== Delete Rule ===== |
| - | CD " | + | **** |
| - | ====== Firewall ====== | + | " |
| - | * 80/tcp is HTTP | + | ====== Check Defaults ====== |
| - | * 443/tcp is HTTPS | + | |
| - | netsh advfirewall firewall add rule name="nginx HTTP" dir=" | + | ==== nginx ==== |
| - | netsh advfirewall firewall add rule name=" | + | **** |
| + | |||
| + | CD "%SystemDrive%\nginx-"*"\conf" | ||
| + | |||
| + | ==== PHP ==== | ||
| + | |||
| + | CD " | ||
| + | |||
| + | CD " | ||
| ====== nginx Settings ====== | ====== nginx Settings ====== | ||
| - | ===== Folders | + | ===== confs ===== |
| - | MKDIR " | + | MKDIR " |
| - | MKDIR " | + | MKDIR " |
| - | MKDIR " | + | ===== Folders ===== |
| - | MKDIR " | + | **** |
| - | | + | |
| ===== HTTPS Redirect ===== | ===== HTTPS Redirect ===== | ||
| Line 73: | Line 81: | ||
| * This automatically redirects non-HTTPS site links to HTTPS | * This automatically redirects non-HTTPS site links to HTTPS | ||
| - | notepad " | + | |
| < | < | ||
| server { | server { | ||
| - | | + | listen |
| - | listen [::]:80 default_server; | + | |
| - | | + | return |
| - | }</ | + | } |
| + | |||
| + | # End</ | ||
| ===== Non-existent 404 ===== | ===== Non-existent 404 ===== | ||
| - | * This prevents unconfigured subdomains from loading assets from other sites ((if a site/URL doesn' | + | * This prevents unconfigured subdomains from loading assets from other sites ((if a site/URL doesn' |
| - | notepad " | + | |
| < | < | ||
| server { | server { | ||
| - | | + | listen " |
| - | http2 " | + | http2 " |
| - | server_name " | + | |
| - | | + | return " |
| - | }</ | + | } |
| + | |||
| + | # End</ | ||
| ===== Headers ===== | ===== Headers ===== | ||
| Line 102: | Line 114: | ||
| * Add to individual site configs as an '' | * Add to individual site configs as an '' | ||
| - | notepad " | + | |
| < | < | ||
| - | add_header Strict-Transport-Security " | + | add_header |
| - | add_header X-Content-Type-Options " | + | add_header |
| - | add_header X-Frame-Options " | + | add_header |
| - | add_header X-XSS-Protection "1; mode=block" | + | add_header |
| - | add_header Cache-Control "no-store, no-transform, | + | add_header |
| - | add_header Referrer-Policy " | + | add_header |
| - | add_header Expect-CT " | + | add_header |
| - | add_header Permissions-Policy " | + | add_header |
| + | |||
| + | # End</ | ||
| ===== nginx ===== | ===== nginx ===== | ||
| - | | + | |
| - | + | ||
| - | | + | |
| < | < | ||
| - | worker_processes | + | worker_processes |
| + | error_log " | ||
| events { | events { | ||
| - | worker_connections | + | multi_accept " |
| + | | ||
| } | } | ||
| - | |||
| - | # | ||
| - | # | ||
| - | # | ||
| http { | http { | ||
| + | | ||
| - | # Logging | + | include |
| - | # | + | include |
| - | # | + | include |
| - | # | + | |
| - | # | + | sendfile " |
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| - | # Includes | + | gzip " |
| - | | + | gzip_vary " |
| - | | + | gzip_proxied " |
| - | | + | gzip_comp_level " |
| - | | + | gzip_types " |
| + | } | ||
| - | | + | # End</ |
| - | sendfile on; | + | |
| - | tcp_nopush on; | + | |
| - | tcp_nodelay on; | + | |
| - | keepalive_timeout 65; | + | |
| - | types_hash_max_size 4096; | + | |
| - | server_names_hash_bucket_size 64; | + | |
| - | # gzip | + | CD " |
| - | gzip on; | + | |
| - | gzip_vary on; | + | |
| - | gzip_proxied any; | + | |
| - | gzip_comp_level 9; | + | |
| - | gzip_types | + | |
| - | }</ | + | |
| ==== CSP Headers ==== | ==== CSP Headers ==== | ||
| Line 166: | Line 171: | ||
| * The empty CSP allows all and can be useful for new site bring-ups, and should be placed in site-specific configs underneath the '' | * The empty CSP allows all and can be useful for new site bring-ups, and should be placed in site-specific configs underneath the '' | ||
| - | < | + | < |
| - | < | + | < |
| ====== SSL Certs ====== | ====== SSL Certs ====== | ||
| Line 178: | Line 183: | ||
| ==== Settings ==== | ==== Settings ==== | ||
| - | notepad " | + | |
| < | < | ||
| Line 194: | Line 199: | ||
| ssl_prefer_server_ciphers " | ssl_prefer_server_ciphers " | ||
| ssl_ecdh_curve " | ssl_ecdh_curve " | ||
| - | |||
| - | ssl_stapling " | ||
| - | ssl_stapling_verify " | ||
| - | resolver " | ||
| - | resolver_timeout " | ||
| # End</ | # End</ | ||
| - | ====== | + | ====== |
| - | MKDIR " | + | MKDIR " |
| - | explorer " | + | |
| ===== Start ===== | ===== Start ===== | ||
| - | notepad " | + | |
| < | < | ||
| + | @echo off | ||
| + | |||
| + | TITLE nginx | ||
| CD " | CD " | ||
| - | " | ||
| - | |||
| - | " | ||
| - | |||
| - | ==== Autostart ==== | ||
| - | explorer | + | " |
| - | " | + | :: End</ |
| - | nginx | + | |
| ===== Stop ===== | ===== Stop ===== | ||
| - | notepad " | + | |
| < | < | ||
| + | @echo off | ||
| + | |||
| + | TITLE nginx Stop | ||
| CD " | CD " | ||
| - | " | ||
| - | | + | " |
| + | |||
| + | " | ||
| + | " | ||
| + | |||
| + | CD " | ||
| + | |||
| + | :: End</ | ||
| + | |||
| + | | ||
| ===== Reload ===== | ===== Reload ===== | ||
| - | notepad " | + | |
| < | < | ||
| + | @echo off | ||
| + | |||
| CD " | CD " | ||
| - | " | ||
| - | " | ||
| - | | + | " |
| + | " | ||
| - | ====== TODOs ====== | + | CD " |
| - | ===== Resources ===== | + | :: End</ |
| + | |||
| + | " | ||
| + | |||
| + | ====== Task Scheduler ====== | ||
| + | |||
| + | ===== nginx ===== | ||
| + | |||
| + | * Auto-start | ||
| + | |||
| + | " | ||
| + | |||
| + | ====== Resources | ||
| * https:// | * https:// | ||
| Line 256: | Line 278: | ||
| * https:// | * https:// | ||
| * https:// | * https:// | ||
| + | * [[https:// | ||
| + | |||
| + | ====== TODO ====== | ||
| + | |||
| + | ===== Exploit Protection ===== | ||
| + | |||
| + | * https:// | ||
| + | |||
| + | ==== nginx ==== | ||
| + | |||
| + | nginx.exe | ||
| + | |||
| + | * Arbitrary code guard (ACG): On | ||
| + | * '' | ||
| + | * Block low integrity images: On | ||
| + | * Block remote images: On | ||
| + | * Block untrusted fonts: On | ||
| + | * Control integrity guard: On | ||
| + | * '' | ||
| + | * Control flow guard (CFG): On | ||
| + | * :!: '' | ||
| + | * Data Execution Prevention (DEP): On | ||
| + | * '' | ||
| + | * Disable extension points: On | ||
| + | * :!: Disable Win32k system calls: Off | ||
| + | * :!: Do not allow child processes: Off | ||
| + | * Export address filtering (EAF): On | ||
| + | * '' | ||
| + | * Force randomization for images (Mandatory ASLR): On | ||
| + | * '' | ||
| + | * Hardware-enforced Stack Protection: On | ||
| + | * '' | ||
| + | * Import address filtering (IAF): On | ||
| + | * Randomize memory allocations (Bottom-up ASLR): On | ||
| + | * '' | ||
| + | * Simulate execution (SimExec): On | ||
| + | * Validate API invocation (CallerCheck): | ||
| + | * Validate exception chains (SEHOP): On | ||
| + | * Validate handle usage: On | ||
| + | * Validate heap integrity: On | ||
| + | * Validate image dependency integrity: On | ||
| + | * Validate stack integrity (StackPivot): | ||
| + | |||
| + | ==== PHP-CGI ==== | ||
| + | |||
| + | php-cgi.exe | ||
| + | |||
| + | * :!: Arbitrary code guard (ACG): Off | ||
| + | * Block low integrity images: On | ||
| + | * Block remote images: On | ||
| + | * Block untrusted fonts: On | ||
| + | * :!: Control integrity guard: Off | ||
| + | * Control flow guard (CFG): On | ||
| + | * :!: '' | ||
| + | * Data Execution Prevention (DEP): On | ||
| + | * '' | ||
| + | * Disable extension points: On | ||
| + | * :!: Disable Win32k system calls: Off | ||
| + | * :!: Do not allow child processes: Off | ||
| + | * Export address filtering (EAF): On | ||
| + | * '' | ||
| + | * Force randomization for images (Mandatory ASLR): On | ||
| + | * '' | ||
| + | * Hardware-enforced Stack Protection: On | ||
| + | * '' | ||
| + | * Import address filtering (IAF): On | ||
| + | * Randomize memory allocations (Bottom-up ASLR): On | ||
| + | * '' | ||
| + | * Simulate execution (SimExec): On | ||
| + | * Validate API invocation (CallerCheck): | ||
| + | * Validate exception chains (SEHOP): On | ||
| + | * Validate handle usage: On | ||
| + | * Validate heap integrity: On | ||
| + | * Validate image dependency integrity: On | ||
| + | * Validate stack integrity (StackPivot): | ||
/usr/local/www/wiki/data/attic/servers/windows/nginx_php_php-cgi.1736226876.txt.gz · Last modified: by Sean Rhone
