403 Forbidden in nginx/1.12.0 after Install SSL (CentOS6)

Posted July 15, 2017 13.4k views

I’m install Wordpress in CentOS 6 (Nginx)
After installed SSL Certificat I stumble
In error 403 Forbidden nginx/1.12.0


HTTPS server

server {
listen 443;

ssl on;
sslcertificate /etc/ssl/serverchain.crt;
sslcertificatekey /etc/nginx/ssl/server.key;

accesslog /var/log/nginx/nginx.vhost.access.log;
log /var/log/nginx/nginx.vhost.error.log;

location / {

root /var/www/;
index index.html;


Please Help Me ?

1 comment

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
3 answers


Post the output of error log, use this command to get the last 20 lines:

tail -20 /var/log/nginx/error.log

So we can help you.

Problem in /etc/nginx/Conf.d/ssl.conf
When you change

location / {

root /var/www/;
index index.html;



location / {

root /var/www/**html**;
index index.**php**;


The page loads as file for download (/var/www/html/index.php)

Hi @Mehdifaik

Can you please post your server block configuration, which should be located in /etc/nginx/sites-enabled/. You can replace your domain with if you want.
Are you using Let’s Encrypt for SSL or some other certificate provider?