After Certbot and LetsEncrypt my domain resolves to ip and not to my wordpress root page

I successfully configured LetsEncrypt to my domain which is domain.com.ar but now it resolves to my server ip and not to the page.

this is the config file in /etc/nginx/sites-available

server {
listen 80;
server_name www.domain.com.ar domain.com.ar;
include snippets/letsencrypt.conf;
return 301 https://$host$request_uri;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { log_not_found off; access_log off; allow all; }
location ~* .(css|gif|ico|jpeg|jpg|js|png) { expires max; log_not_found off; } location ~ \.php {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
}
}
server {
listen 443 ssl http2;
server_name www.domain.com.ar;
root /var/www/wordpress;
index index.php index.html;
ssl_certificate /etc/letsencrypt/live/domain.com.ar/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.com.ar/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/domain.com.ar/chain.pem;
include snippets/ssl.conf;
return 301 https://domain.com.ar$request_uri;
}
server {
listen 443 ssl http2;
server_name domain.com.ar;
ssl_certificate /etc/letsencrypt/live/domain.com.ar/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.com.ar/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/domain.com.ar/chain.pem;
include snippets/ssl.conf;
include snippets/letsencrypt.conf;
}

More info:
Ubuntu 18.04
Nginx

I cannot enter to wp-admin any more to change wordpress option but I can modify the .php files inside the server. I surfed the net all day but cannot make it work

Hi @natigise

please see your config file:

Your port 443 non-www doesn’t have the root of your www. So the result is the standard nginx page.

2 Likes

Now your port 443 non www shows content.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.