Loss of access to Django Admin after LE Install

Hey All

Following on from successful closure of this issue: New Server, New IP address same Domain name , I can no longer access Django Admin application.

https://inkblotcreations.com/admin gives me “404 Not Found - nginx/1.10.0 (Ubuntu)”

Application worked prior to install of LE

I’m guessing that the redirection from HTTP to HTTPS is dropping the proxy_params (in first server block) . Does this mean that I have to replicate code from first server block to second (seems inefficient)? Or move it? Or something else?

Operating system: Ubutu 16.04
Web server: Nginx 1.10.0
Hosting provider: Digital Ocean
I can login to a root shell: Yes
Not using a control panel to manage my site.

Current version of Nginx configuration:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name inkblotcreations.com www.inkblotcreations.com 188.166.255.248;
return 301 https://$server_name$request_uri;
root /var/www/inkblotcreations;

location = /favicon.ico {
    access_log off;
    log_not_found off;
}

location /static/ { root /home/catz/src; }

location / {
    include proxy_params;
    proxy_pass http://unix:/home/catz/src/inkblot.sock;
}

location /.well-known/acme-challenge/ {
    allow all;
}

}

server {

# SSL configuration

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

}

Looks like in the process of asking the question I figured it out.

In the Nginx config I move all code from first (HTTP) server block to second (HTTPS) block other than redirection code (of course).

Seems to work fine now.

Below is my updated Nginx config. Is there some other code that should stay in the first block? Should I do anything else?

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    return 301 https://inkblotcreations.com;
}

server {
    # SSL configuration
    listen 443 ssl http2 default_server;
    listen [::]:443 ssl http2 default_server;
    include snippets/ssl-inkblotcreations.com.conf;
    include snippets/ssl-params.conf;

    server_name inkblotcreations.com www.inkblotcreations.com 188.166.255.248;

    root /var/www/inkblotcreations;

    location = /favicon.ico {
        access_log off;
        log_not_found off;
    }

    location /static/ { root /home/catz/src; }

    location / {
        include proxy_params;
        proxy_pass http://unix:/home/catz/src/inkblot.sock;
    }

    location /.well-known/acme-challenge/ { allow all; }
}
1 Like

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