chore: initialize dockerized wordpress stack
This commit is contained in:
49
config/nginx/default.conf
Normal file
49
config/nginx/default.conf
Normal file
@@ -0,0 +1,49 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
root /var/www/html;
|
||||
index index.php index.html;
|
||||
|
||||
# Trust real client IPs forwarded by Traefik
|
||||
set_real_ip_from 172.19.0.0/16;
|
||||
set_real_ip_from 172.21.0.0/16;
|
||||
real_ip_header X-Forwarded-For;
|
||||
real_ip_recursive on;
|
||||
|
||||
# Basic compression for text assets
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/json application/javascript application/xml+rss image/svg+xml;
|
||||
gzip_comp_level 5;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
include fastcgi_params;
|
||||
fastcgi_pass wordpress:9000;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
fastcgi_param HTTP_X_FORWARDED_FOR $proxy_add_x_forwarded_for;
|
||||
fastcgi_param HTTP_X_FORWARDED_PROTO $http_x_forwarded_proto;
|
||||
fastcgi_param HTTPS $http_x_forwarded_proto;
|
||||
fastcgi_buffers 16 16k;
|
||||
fastcgi_buffer_size 32k;
|
||||
fastcgi_read_timeout 120s;
|
||||
fastcgi_send_timeout 120s;
|
||||
fastcgi_connect_timeout 60s;
|
||||
}
|
||||
|
||||
location ~* \.(?:css|js|jpg|jpeg|gif|png|svg|ico|webp|avif)$ {
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, no-transform";
|
||||
access_log off;
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
client_max_body_size 64m;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
}
|
||||
Reference in New Issue
Block a user