40 lines
1.0 KiB
Plaintext
40 lines
1.0 KiB
Plaintext
|
|
server {
|
|
listen 80;
|
|
server_name ${APP_DOMAIN};
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
location /.well-known/acme-challenge/ {
|
|
root /var/www/certbot;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name ${APP_DOMAIN};
|
|
server_tokens off;
|
|
client_max_body_size 20M;
|
|
index index.php index.html index.htm;
|
|
root /var/www/wordpress;
|
|
|
|
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_certificate /etc/letsencrypt/live/${APP_DOMAIN}/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/${APP_DOMAIN}/privkey.pem;
|
|
include /etc/letsencrypt/options-ssl-nginx.conf;
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
|
|
|
location / {
|
|
proxy_pass http://wordpress;
|
|
proxy_redirect off;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Host $server_name;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
}
|