windows:servers:nginx_php_php-fpm
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
windows:servers:nginx_php_php-fpm [2024/05/19 19:30] – created Sean Rhone | windows:servers:nginx_php_php-fpm [2024/06/27 19:58] (current) – changed page slug to cgi instead of fpm Sean Rhone | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Information ====== | ||
- | |||
- | * nginx ((https:// | ||
- | * PHP + PHP-FPM ((https:// | ||
- | * [[Information: | ||
- | |||
- | * :!: 20240519: This is experimental and WIP | ||
- | |||
- | ===== Prerequisites ===== | ||
- | |||
- | * [[windows: | ||
- | |||
- | ===== Resources ===== | ||
- | |||
- | * https:// | ||
- | * https:// | ||
- | * https:// | ||
- | * https:// | ||
- | |||
- | ====== Install ====== | ||
- | |||
- | ===== nginx ===== | ||
- | |||
- | * https:// | ||
- | |||
- | * Extract to '' | ||
- | |||
- | ===== PHP-FPM ===== | ||
- | |||
- | * https:// | ||
- | * x64 Non Thread Safe | ||
- | |||
- | * Extract to '' | ||
- | |||
- | ===== PHP Extensions ===== | ||
- | |||
- | ==== Verify Modules ==== | ||
- | |||
- | **** | ||
- | |||
- | " | ||
- | |||
- | ====== Firewall ====== | ||
- | |||
- | * 80/tcp is HTTP | ||
- | * 443/tcp is HTTPS | ||
- | |||
- | netsh advfirewall firewall add rule name=" | ||
- | |||
- | netsh advfirewall firewall add rule name=" | ||
- | |||
- | ====== Config Defaults ====== | ||
- | |||
- | ===== Backup ===== | ||
- | |||
- | sudo mv '/ | ||
- | |||
- | sudo mv '/ | ||
- | |||
- | sudo mv '/ | ||
- | |||
- | sudo mv '/ | ||
- | |||
- | ===== View ===== | ||
- | |||
- | nano '/ | ||
- | |||
- | nano '/ | ||
- | |||
- | nano '/ | ||
- | |||
- | nano '/ | ||
- | |||
- | nano '/ | ||
- | |||
- | ====== nginx Settings ====== | ||
- | |||
- | ===== Notes ===== | ||
- | |||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | |||
- | ===== Defaults ===== | ||
- | |||
- | ==== vhosts.d ==== | ||
- | |||
- | **** | ||
- | |||
- | sudo mkdir -p '/ | ||
- | |||
- | ===== HTTPS Redirect ===== | ||
- | |||
- | * This automatically redirects non-HTTPS site links to HTTPS | ||
- | |||
- | sudo -e '/ | ||
- | |||
- | < | ||
- | server { | ||
- | listen 80 default_server; | ||
- | listen [::]:80 default_server; | ||
- | |||
- | return 301 https:// | ||
- | }</ | ||
- | |||
- | ===== Non-existent 404 ===== | ||
- | |||
- | * This prevents unconfigured subdomains from loading assets from other sites ((if a site/URL doesn' | ||
- | |||
- | sudo -e '/ | ||
- | |||
- | < | ||
- | server { | ||
- | listen ' | ||
- | server_name ' | ||
- | |||
- | return ' | ||
- | }</ | ||
- | |||
- | ===== Headers ===== | ||
- | |||
- | * Last updated: 2024/02/07 | ||
- | * Add to individual site configs as an '' | ||
- | |||
- | sudo -e '/ | ||
- | |||
- | < | ||
- | add_header Strict-Transport-Security " | ||
- | add_header X-Content-Type-Options " | ||
- | add_header X-Frame-Options " | ||
- | add_header X-XSS-Protection "1; mode=block" | ||
- | add_header Cache-Control " | ||
- | add_header Referrer-Policy " | ||
- | add_header Expect-CT " | ||
- | add_header Permissions-Policy " | ||
- | |||
- | ===== nginx ===== | ||
- | |||
- | * :!: Last updated: 2023/09/12 | ||
- | |||
- | sudo -e '/ | ||
- | |||
- | < | ||
- | user nginx; | ||
- | worker_processes auto; | ||
- | error_log / | ||
- | pid / | ||
- | |||
- | include / | ||
- | |||
- | events { | ||
- | worker_connections 1024; | ||
- | } | ||
- | |||
- | http { | ||
- | |||
- | # Logging | ||
- | log_format | ||
- | ' | ||
- | '" | ||
- | |||
- | access_log | ||
- | |||
- | # Includes | ||
- | include / | ||
- | include / | ||
- | include / | ||
- | default_type application/ | ||
- | |||
- | # Config | ||
- | sendfile on; | ||
- | tcp_nopush on; | ||
- | tcp_nodelay on; | ||
- | keepalive_timeout 65; | ||
- | types_hash_max_size 4096; | ||
- | |||
- | # gzip | ||
- | gzip on; | ||
- | gzip_vary on; | ||
- | gzip_proxied any; | ||
- | gzip_comp_level 9; | ||
- | gzip_types *; | ||
- | } | ||
- | |||
- | # End</ | ||
- | |||
- | ==== CSP Headers ==== | ||
- | |||
- | * 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 ====== | ||
- | |||
- | ===== Let's Encrypt ===== | ||
- | |||
- | * See [[Servers: | ||
- | |||
- | ==== Settings ==== | ||
- | |||
- | notepad++ " | ||
- | |||
- | < | ||
- | ssl_certificate '/ | ||
- | ssl_trusted_certificate '/ | ||
- | ssl_certificate_key '/ | ||
- | |||
- | ssl_session_timeout ' | ||
- | ssl_session_cache ' | ||
- | ssl_session_tickets ' | ||
- | ssl_buffer_size ' | ||
- | |||
- | ssl_protocols ' | ||
- | ssl_ciphers ' | ||
- | ssl_prefer_server_ciphers ' | ||
- | ssl_ecdh_curve ' | ||
- | |||
- | ssl_stapling ' | ||
- | ssl_stapling_verify ' | ||
- | resolver ' | ||
- | resolver_timeout ' | ||
- | |||
- | # End</ | ||
/usr/local/www/wiki/data/attic/windows/servers/nginx_php_php-fpm.1716161448.txt.gz · Last modified: by Sean Rhone