I can not remove the default page that NGINX has

Hello, I have a problem that I can not solve well, the problem that I try to solve is that when installing a SSL certificate for free Let Encrypt always redirects me to the default page of NGINX telling me Welcome.

I have tried to look for that index, but I already have it removed and I do not know where it is taking, I really have a website already installed that should be displayed and not that default NGINX page when installing the SSL certificate, before installing SSL showed me my website without any problems, but now that I installed the free Let Encrypt SSL, it always shows me the default page containing NGINX.

this is my code server:

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    return 301 https://$server_name$request_uri;


    # SSL configuration
    # listen 443 ssl default_server;
    # listen [::]:443 ssl default_server;
    # Note: You should disable gzip for SSL traffic.
    # See:
    # Read up on ssl_ciphers to ensure a secure configuration.
    # See:
    # Self signed certs generated by the ssl-cert package
    # Don't use them in a production server!
    # include snippets/snakeoil.conf;

    root /var/www/html/wordpress;

    # Add index.php to the list if you are using PHP
    index index.php index.html index.htm;

    location ~ /.well-known {
               allow all;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        #try_files $uri $uri/ =404;
        try_files $uri $uri/ /index.php?q=$uri&$args;

    #Seguridad de acceso a PHPMyAdmin
    location /jsjf {
        auth_basic "Admin Login";
        auth_basic_user_file /etc/nginx/pma_pass;

    # pass the PHP scripts to FastCGI server listening on
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
    #   # With php7.0-cgi alone:
    #   fastcgi_pass;
    #   # With php7.0-fpm:
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #location ~ /\.ht {
    #   deny all;

    #Especificar Cache en el navegador
    location ~* \.(gif|jpg|jpeg|png|ico|wmv|3gp|avi|mpg|mpeg|mp4|flv|mp3|mid|js|css|wml|swf|woff|ttf)$ {
        root /var/www/html/wordpress;
        expires max;
        add_header Pragma public;
        add_header Cache-Control "public, must-revalidate, proxy-revalidate";


#Configuracion SSL
server {

    # SSL configuration

    listen 443 ssl http2 default_server;
    listen [::]:443 ssl http2 default_server;
    include snippets/;
    include snippets/ssl-params.conf;

What could I do to solve this problem and that my website can show up well with SSL?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

I do not understand, where do you want me to try to put it? Excuse me and thank you for actually responding.


Try to move every thing after return 301 https://$server_name$request_uri; to the second server block.

Hope this helps.