Create and attach ssl certificate to nginx
1. create ssl certificate
Use this labe to create ssl certificate
2. edit the wordpress.conf file (/etc/nginx/conf.d/wordpress.conf)
vi /etc/nginx/conf.d/wordpress.conf
3. Append the block of code below to existing configurations
server {
listen 443;
ssl on;
ssl_certificate /etc/httpd/ssl/server.crt;
ssl_certificate_key /etc/httpd/ssl/server.key;
location / {
proxy_pass http://127.0.0.1:8080/;
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-Proto $scheme;
}
}
Note:- if you are using 443 port on apache then change the port to something else like listen 445