THE ERROR MESSAGE
IMPORTANT NOTES:
-
The following errors were reported by the server:
Domain: subdomain.example.com
404 Not Found
Type: unauthorized
Detail: Invalid response from
http://subdomain.example.com/.well-known/acme-challenge/:
"404 Not Found
"
PRELIMINARY STEPS
- apt-get update
- apt-get upgrade
- cd …
- mkdir var/www
- cd var/www
- mkdir subdomain.example.com
- sudo apt install docker.io
- docker pull creativitykills/nginx-php-server:1.1.1
- docker run -d -p 1234:80 \
- –name subdomain \
- -v /var/www/subdomain.example.com:/var/www/public \
- creativitykills/nginx-php-server:1.1.1
- nano /var/www/subdomain.example.com/index.html
-
Example Site
This is my example site
INSTALL NGINX
15. apt install nginx
16. touch /etc/nginx/sites-available/subdomain.example.com.conf
17. server {listen 80;listen [::]:80;server_name subdomain.example.com www.subdomain.example.com;location / {proxy_pass http://0.0.0.0:1234;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;}}
18. ln -s /etc/nginx/sites-available/subdomain.example.com.conf /etc/nginx/sites-enabled/subdomain.example.com.conf
19. /etc/init.d/nginx reload
INSTALL LET’S ENCRYPT
- apt-get update
- apt-get install software-properties-common
- add-apt-repository ppa:certbot/certbot
- apt-get update
- apt-get install python-certbot-nginx
- certbot --authenticator standalone --installer nginx --pre-hook “nginx -s stop” --post-hook “nginx”
- certbot renew --dry-run
- openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
- nano /etc/nginx/sites-available/subdomain.example.com.conf
- server {listen 80;listen [::]:80;server_name subdomain.example.com www.subdomain.example.com;location “/.well-known/acme-challenge” {default_type “text/plain”;root /var/www/subdomain.example.com;allow all;}location / {proxy_pass http://0.0.0.0:1234;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;}}
- /etc/init.d/nginx reload
- ping subdomain.example.com
- was your domain name entered correctly?
- do the DNS A record(s) for that domain contain(s) the right IP address?
- is the domain routed to your ip address?
- control + z
- letsencrypt certonly -a webroot
–webroot-path=/var/www/subdomain.example.com
-d subdomain.example.com -d www.subdomain.example.com
Can you please tell me what I have done wrong?