Files
news-platform/wordpress/nginx/wordpress.conf
T
Artur MoreiraandPaperclip a77c293d0e feat(wordpress): nginx + PHP-FPM stacks; retire Apache images (BIT-578)
- Use wordpress:6-php8.3-fpm with nginx:alpine sidecars; keep host ports 8080/8081
- Add shared wp_html / wp_andebol_html volumes so nginx can serve the same docroot as FPM
- Nginx: try_files permalinks, proxy headers, HTTP_AUTHORIZATION for App Passwords
- Update deploy scripts to force-recreate nginx with wordpress when public URL is fixed
- Refresh README and deployment docs

Co-Authored-By: Paperclip <[email protected]>
Made-with: Cursor
2026-03-28 01:15:51 +00:00

58 lines
1.6 KiB
Plaintext

# Nginx front for WordPress PHP-FPM (main site). Published as host :8080 → container :80.
# Replaces Apache mod_rewrite (.htaccess) with try_files + fastcgi.
server {
listen 80;
listen [::]:80;
server_name _;
root /var/www/html;
index index.php;
client_max_body_size 64M;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass wordpress:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTP_AUTHORIZATION $http_authorization;
fastcgi_param HTTP_X_FORWARDED_PROTO $http_x_forwarded_proto;
fastcgi_param HTTP_X_FORWARDED_FOR $http_x_forwarded_for;
fastcgi_param HTTP_X_REAL_IP $http_x_real_ip;
fastcgi_param HTTP_X_FORWARDED_HOST $http_x_forwarded_host;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires max;
log_not_found off;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
log_not_found off;
access_log off;
}
location ~ /\. {
deny all;
}
}