Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error report Challenge failed for domain #75

Open
234146326 opened this issue Jun 15, 2020 · 10 comments
Open

Error report Challenge failed for domain #75

234146326 opened this issue Jun 15, 2020 · 10 comments

Comments

@234146326
Copy link

234146326 commented Jun 15, 2020

nginx.conf:

upstream fastcgi_backend {
    # use tcp connection
    server  php-fpm:9000;
    # or socket
    # server   unix:/run/php/php7.3-fpm.sock;
}


server {
    listen 80 default;
    server_name xx.com;
    server_tokens off;
#    client_max_body_size 108M;

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

    #root /application/public/pub;
    set $MAGE_ROOT /application/public;
    # include /application/public/nginx.conf.sample;
    #index index.php;

    location /.well-known/acme-challenge/ {
        root /var/www/certbot;
    }

    location / {
        return 301 https://$host$request_uri;
    }

#    if (!-e $request_filename) {
#        rewrite ^.*$ /index.php last;
#    }

#    location ~ \.php$ {
#        fastcgi_pass php-fpm:9000;
#        fastcgi_index index.php;
#        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#        fastcgi_param PHP_VALUE "error_log=/var/log/nginx/application_php_errors.log";
#        fastcgi_buffers 16 16k;
#        fastcgi_buffer_size 32k;
#        include fastcgi_params;
#    }
    
}

server {
    listen 443 ssl;
    server_name xx.com;
    server_tokens off;

    ssl_certificate /etc/letsencrypt/live/example.org/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.org/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

    location / {
        proxy_pass  http://xx.com;
        proxy_set_header    Host                $http_host;
        proxy_set_header    X-Real-IP           $remote_addr;
        proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;
    }
}


image

Thanks for the enthusiastic reply.Thank you

@wmnnd @michal-wrzosek
@mestrogov @Pixep @ynixon

@weleoka
Copy link

weleoka commented Jun 15, 2020

  • Check your DNS records are pointing to the right server
  • Check your server firewall is not blocking the ACME challenge process

@234146326
Copy link
Author

  • Check your DNS records are pointing to the right server
  • Check your server firewall is not blocking the ACME challenge process

Thanks for your reply, I will use your suggestion tracking.

@234146326
Copy link
Author

  • Check your DNS records are pointing to the right server
  • Check your server firewall is not blocking the ACME challenge process

Thanks for your reply, I will use your suggestion tracking.

DNS:
image

@234146326
Copy link
Author

@weleoka @wmnnd @michal-wrzosek
@mestrogov @Pixep @ynixon @DocDagbjort

No matter what I do, I can't solve this error. Hope to be concerned.Thank you

@weleoka
Copy link

weleoka commented Jun 15, 2020

You could run the nginx container standalone and see if you can access it with HTTP only from outside.

docker-compose run --service-ports --rm --entrypoint "ash" nginx. Try the command nginx from withing the container see if any feedback.

Check in another console (or in tmux window if multiplexing) that docker ps -a shows ports mapped to host from container as following:

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                                      NAMES
d90500fba632        nginx               "ash"               3 seconds ago       Up 1 second         0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   httpserve_nginx_run_d48309a4afe6

If that's ok, now try and get at a default served page for nginx... or some sort of error. Run cat /var/log/nginx/access.log in your ash prompt in the container.

Curl your localhost or VPS and see if you get some sort of nginx forbidden page. curl localhost or curl 123.123.123.123. Better still: curl your VPS using it's DNS record domainname: curl my.examplemachine.com.

If this works then there's some other reason letsencrypt ceritificate signing is failing.

@234146326
Copy link
Author

if y

image

Hello, multiple dockers can use nginx normally. Cannot run alone.

I have used fpm:

upstream fastcgi_backend {
    # use tcp connection
    server  php-fpm:9000;
    # or socket
    # server   unix:/run/php/php7.3-fpm.sock;
}

Run alone:
image

In nginx container :

image

@weleoka
thank you for your reply。

@234146326
Copy link
Author

234146326 commented Jun 15, 2020

You could run the nginx container standalone and see if you can access it with HTTP only from outside.

docker-compose run --service-ports --rm --entrypoint "ash" nginx. Try the command nginx from withing the container see if any feedback.

Check in another console (or in tmux window if multiplexing) that docker ps -a shows ports mapped to host from container as following:

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                                      NAMES
d90500fba632        nginx               "ash"               3 seconds ago       Up 1 second         0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   httpserve_nginx_run_d48309a4afe6

If that's ok, now try and get at a default served page for nginx... or some sort of error. Run cat /var/log/nginx/access.log in your ash prompt in the container.

Curl your localhost or VPS and see if you get some sort of nginx forbidden page. curl localhost or curl 123.123.123.123. Better still: curl your VPS using it's DNS record domainname: curl my.examplemachine.com.

If this works then there's some other reason letsencrypt ceritificate signing is failing.

if y

image

Hello, multiple dockers can use nginx normally. Cannot run alone.

I have used fpm:

upstream fastcgi_backend {
    # use tcp connection
    server  php-fpm:9000;
    # or socket
    # server   unix:/run/php/php7.3-fpm.sock;
}

Run alone:
image

In nginx container :

image

@weleoka
thank you for your reply。

#I# I solved this problem through the following process;

  1. Initialize nginx.conf to:

server {
    listen 80;
    server_name <xx.com>;
    server_tokens off;

    location /.well-known/acme-challenge/ {
        root /var/www/certbot;
    }

    location / {
        return 301 https://$host$request_uri;
    }
}
  1. ./init-letsencrypt.sh > No accident, I encountered the following error.

image

execution :

ifconfig eth0 mtu 1300

3 ./init-letsencrypt.sh > Successfully generated data directory

  1. Reconfigure Nginx.conf.

谢谢 @weleoka Provide valuable responses.Thanks everyone.

@weleoka
Copy link

weleoka commented Jun 17, 2020

Mark resolved.

@uyscuti-wiki
Copy link

Thanks @234146326, you're a life saver!

@jbingel
Copy link

jbingel commented Sep 23, 2020

You could run the nginx container standalone and see if you can access it with HTTP only from outside.

docker-compose run --service-ports --rm --entrypoint "ash" nginx. Try the command nginx from withing the container see if any feedback.

Check in another console (or in tmux window if multiplexing) that docker ps -a shows ports mapped to host from container as following:

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                                      NAMES
d90500fba632        nginx               "ash"               3 seconds ago       Up 1 second         0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   httpserve_nginx_run_d48309a4afe6

If that's ok, now try and get at a default served page for nginx... or some sort of error. Run cat /var/log/nginx/access.log in your ash prompt in the container.

Curl your localhost or VPS and see if you get some sort of nginx forbidden page. curl localhost or curl 123.123.123.123. Better still: curl your VPS using it's DNS record domainname: curl my.examplemachine.com.

If this works then there's some other reason letsencrypt ceritificate signing is failing.

@weleoka can you be more specific as to what the "other reason letsencrypt ceritificate signing is failing" might be? All of this works for me, but eventually I still get a Challenged failed for my domain.

EDIT nevermind, the problem was this one: #86 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants