server { listen 80; listen [::]:80; server_name localhost; return 301 https://$host$request_uri; } server { listen 443 ssl; listen [::]:443 ssl; server_name localhost; ssl_certificate /etc/nginx/ssl/inception.pem; ssl_certificate_key /etc/nginx/ssl/inception.key; ssl_protocols TLSv1.2 TLSv1.3; root /var/www/html/public; index index.php index.html; location / { try_files $uri $uri/ =404; } location /wordpress { root /var/www; try_files $uri $uri/ /wordpress/index.php?$args; location ~ /wordpress/(.+\.php)$ { include fastcgi_params; fastcgi_pass wordpress:9000; fastcgi_index index.php; fastcgi_intercept_errors on; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param HTTPS on; } } }