File: //etc/nginx/sites-enabled/wordpress
# -----------------------------
# HTTP → HTTPS redirect
# -----------------------------
server {
listen 80;
server_name xpay-mariam-shop.shop www.xpay-mariam-shop.shop;
return 301 https://$host$request_uri;
}
# -----------------------------
# HTTPS server
# -----------------------------
server {
listen 443 ssl http2;
server_name xpay-mariam-shop.shop www.xpay-mariam-shop.shop;
root /home/ubuntu/public;
index index.php index.html index.htm;
# SSL (Let's Encrypt)
ssl_certificate /etc/letsencrypt/live/www.xpay-mariam-shop.shop/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.xpay-mariam-shop.shop/privkey.pem;
# Recommended SSL settings
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
# -----------------------------
# WordPress routing (VERY IMPORTANT)
# -----------------------------
location / {
try_files $uri $uri/ /index.php?$args;
}
# -----------------------------
# PHP handling
# -----------------------------
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
}
# -----------------------------
# Apple Pay verification
# -----------------------------
location ^~ /.well-known/ {
allow all;
}
# -----------------------------
# Security
# -----------------------------
location ~ /\.ht {
deny all;
}
}