Score:0

Nginx Reverse proxy acme challenge 404 error

th flag

I have a vhost which seems to work fine except when trying to generate SSL keep getting errors. Can some one help me to spot what is going wrong please? Thanks

    example.com: Domain could not be validated, error message: error type: urn:ietf:params:acme:error:unauthorized, error detail:
192.168.9.123: Invalid response from https://example.com/.well-known/acme-challenge/NOHITCjOoL1lpdh-Oh1pHUSnXvkSk00ksjBeVCWA2cY: 404

nginx vhost config:

upstream domain-default {
  zone domain-default 64k;
  server 172.31.7.1:9001;
  keepalive 2;
}

upstream domain-ws {
  zone domain-ws 64k;
  server 172.31.7.1:3012;
  keepalive 2;
}

# Redirect HTTP to HTTPS
server {
    listen 80;
    listen [::]:80;
    server_name example.com;
   return 301 https://$host$request_uri;
    {{root}}
    
location ~ /.well-known {
    allow all;
    {{root}}
  }

}


server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name example.com;


    if ($scheme != "https") {
    rewrite ^ https://$host$uri permanent;
    }
 
  {{ssl_certificate_key}}
  {{ssl_certificate}}
  
    client_max_body_size 128M;

    location / {
  proxy_http_version 1.1;
  proxy_set_header "Connection" "";
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Forwarded-Proto $scheme;
  proxy_pass http://domain-default;
    }

    location /notifications/hub/negotiate {
  proxy_http_version 1.1;
  proxy_set_header "Connection" "";
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Forwarded-Proto $scheme;
  proxy_pass http://domain-default;
    }

    location /notifications/hub {
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "upgrade";
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header Forwarded $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Forwarded-Proto $scheme;
  proxy_pass http://domain-ws;
    }

    
    location ~ /.well-known {
    allow all;
  }

}
Score:0
us flag

The Error itself Says example.com Domain cannot be verified, you have to replace example.com with your domain. Don't forget to Point the IP address of the server to the domain name, it will be done.

Tapash avatar
th flag
Thanks for your reply, but the domain in actual config is correct as well as DNS pointing to the correct IP.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.