Question

Getting "Welcome to Nginx" message after installing letsencrypt certbot on ubuntu 16.04

After going through the tutorial on how to set up django with nginx on ubuntu 16.04 my website was running perfectly fine but after i tried adding the letsencrypt certbot, my domain is working with https but i am getting “Welcome to nginx” message.

any suggestion

https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04

https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04

Subscribe
Share

This comment has been deleted

Most likely if you installed the certbot-nginx version, certbot rewrote your NGINX config to redirect port 80 traffic to port 443. You will need to adjust your NGINX config to accommodate the new configurations.

Can you post your NGINX config file for the website?


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

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.

try this: it worked for me after installing letsencrypt on centos 6 linux

server { listen 80 default_server; server_name {domain-name} ; return 301 https://$server_name$request_uri; }

server { listen 443 ssl http2; server_name {domain-name} ;

ssl on; ssl_certificate /etc/letsencrypt/live/{domain-name}/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/{domain-name}/privkey.pem; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ‘EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH’; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; location / { proxy_pass http://localhost:8080; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection ‘upgrade’; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } location /.well-known/acme-challenge/ { root /var/www/domainame; }

}

The last line acme challenge one is vital for generating your website page. .

nope, i just rebuild the droplet with same configuration (same droplet size, location)…

i never deleted the droplet by myself, but digitalocean does it from there side and gave me a new droplet with same configuration.

This comment has been deleted

This comment has been deleted

This comment has been deleted

This comment has been deleted

user www-data; worker_processes auto; pid /run/nginx.pid;

events { worker_connections 768; # multi_accept on; }

http {

##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;

##
# SSL Settings
##

ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;

##
# Logging Settings
##

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

##
# Gzip Settings
##

gzip on;
gzip_disable "msie6";

# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

##
# Virtual Host Configs
##

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

}

#mail {

# See sample authentication script at:

# http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript

# auth_http localhost/auth.php;

# pop3_capabilities “TOP” “USER”;

# imap_capabilities “IMAP4rev1” “UIDPLUS”;

server {

listen localhost:110;

protocol pop3;

proxy on;

}

server {

listen localhost:143;

protocol imap;

proxy on;

}

#}