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;
server_name zoneclass.com www.zoneclass.com;
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: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# 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 127.0.0.1:9000
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php7.0-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # 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/ssl-zoneclass.com.conf;
include snippets/ssl-params.conf;
}
What could I do to solve this problem and that my website can show up well with SSL?
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!
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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.