wordpress-base

worker_processes 1; pid /run/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; log_format main_timed '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for" ' '$request_time $upstream_response_time $pipe $upstream_cache_status'; access_log /dev/stdout main_timed; error_log /dev/stderr notice; keepalive_timeout 65; server_tokens off; # Enable gzip compression gzip on; gzip_disable "msie6"; gzip_proxied any; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript; server { listen [::]:80 default_server; listen 80 default_server; server_name _; sendfile off; # Increase proxy buffers for large requests proxy_buffer_size 128k; proxy_buffers 4 256k; proxy_busy_buffers_size 256k; # Upload limit client_max_body_size 50m; client_body_buffer_size 128k; root /var/www/html/web; index index.php; include includes/*.conf; location = /favicon.ico { log_not_found off; access_log off; } # Don't cache the service worker, or we'll have to wait up to 24 hours to get a new one location ~* (sw\.js)$ { add_header 'Service-Worker-Allowed' "/"; add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; expires off; proxy_no_cache 1; } # Media: images, icons, video, audio, HTC location ~* \.(?:css|cur|js|jpe?g|gif|htc|ico|png|otf|ttf|eot|woff|svg)$ { add_header Cache-Control "public"; access_log off; expires 1y; tcp_nodelay off; } # Health endpoint (DB independant) location = /healthz { try_files $uri /healthz.php; } location / { # First attempt to serve request as file, then # as directory, then fall back to index.php try_files $uri $uri/ /index.php?$args; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; #fastcgi_intercept_errors on; fastcgi_buffer_size 128k; fastcgi_buffers 4 256k; fastcgi_busy_buffers_size 256k; fastcgi_index index.php; fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } # deny access to . files, for security location ~ /\. { log_not_found off; deny all; } } } worker_processes 1; pid /run/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; log_format main_timed '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for" ' '$request_time $upstream_response_time $pipe $upstream_cache_status'; access_log /dev/stdout main_timed; error_log /dev/stderr notice; keepalive_timeout 65; server_tokens off; # Enable gzip compression gzip on; gzip_disable "msie6"; gzip_proxied any; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript; server { listen [::]:80 default_server; listen 80 default_server; server_name _; sendfile off; # Increase proxy buffers for large requests proxy_buffer_size 128k; proxy_buffers 4 256k; proxy_busy_buffers_size 256k; # Upload limit client_max_body_size 50m; client_body_buffer_size 128k; root /var/www/html/web; index index.php; include includes/*.conf; location = /favicon.ico { log_not_found off; access_log off; } # Don't cache the service worker, or we'll have to wait up to 24 hours to get a new one location ~* (sw\.js)$ { add_header 'Service-Worker-Allowed' "/"; add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; expires off; proxy_no_cache 1; } # Media: images, icons, video, audio, HTC location ~* \.(?:css|cur|js|jpe?g|gif|htc|ico|png|otf|ttf|eot|woff|svg)$ { add_header Cache-Control "public"; access_log off; expires 1y; tcp_nodelay off; } # Health endpoint (DB independant) location = /healthz { try_files $uri /healthz.php; } location / { # First attempt to serve request as file, then # as directory, then fall back to index.php try_files $uri $uri/ /index.php?$args; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; #fastcgi_intercept_errors on; fastcgi_buffer_size 128k; fastcgi_buffers 4 256k; fastcgi_busy_buffers_size 256k; fastcgi_index index.php; fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } # deny access to . files, for security location ~ /\. { log_not_found off; deny all; } } }