Hi All
Done this quite a few times but it seems ive got something in my configuration file incorrect. I have an application (grafana) working on 192.168.1.3:3000 and want to serve this.
error is:
nsautomate@ihp:/etc/nginx/sites-enabled$ sudo certbot certonly --nginx -d chilcote.nsautomate.com.au
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for chilcote.nsautomate.com.au
Waiting for verification…
Cleaning up challenges
Failed authorization procedure. chilcote.nsautomate.com.au (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://chilcote.nsautomate.com.au/.well-known/acme-challenge/ABzB3x_EUcgFbbjONrNlY4yoxkliyk5MgnkvMFJMj6g [180.150.13.216]: “\r\n404 Not Found\r\n<body bgcolor=“white”>\r\n
404 Not Found
\r\n”
IMPORTANT NOTES:
-
The following errors were reported by the server:
Domain: chilcote.nsautomate.com.au
Type: unauthorized
Detail: Invalid response from
http://chilcote.nsautomate.com.au/.well-known/acme-challenge/ABzB3x_EUcgFbbjONrNlY4yoxkliyk5MgnkvMFJMj6g
[180.150.13.216]: “\r\n404 Not
Found\r\n<body bgcolor=“white”>\r\n404
\r\n
Not Found
”To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.
My configuration file is:
upstream ihp {
server 192.168.1.3:3000;
}
server {
listen 80;
listen [::]:80;
server_name chilcote.nsautomate.com.au;
return 301 https://chilcote.nsautomate.com.au$request_uri;
server_tokens off; # This hide server version just in case someones needs it for a hack...
}
server {
listen 443 ssl;
listen [::]:443 ssl http2;
server_name chilcote.nsautomate.com.au;
server_tokens off;
access_log /var/log/nginx/chilcote.nsautomate.com.au/access.log;
error_log /var/log/nginx/chilcote.nsautomate.com.au/error.log;
#### SSL Config
#ssl_certificate /etc/letsencrypt/live/chilcote.nsautomate.com.au/fullchain.pem;
#ssl_certificate_key /etc/letsencrypt/live/chilcote.nsautomate.com.au/privkey.pem;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:20m;
ssl_session_tickets off;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_protocols TLSv1.2 TLSv1.3; # This will affect old Browsers that doesn’t supports new versions of TLS (not SSL ;)).
ssl_prefer_server_ciphers on;
ssl_ecdh_curve secp384r1;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
#### Compression - Can be disabled anytime but will help externally
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 9;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_types text/plain
text/css
application/json
application/javascript
application/x-javascript
text/xml
application/xml
application/xml+rss
text/javascript
application/vnd.ms-fontobject
application/x-font-ttf
font/opentype
image/svg+xml
image/x-icon;
location / {
proxy_pass http://ihp; # Defined on the upstream section
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-SSL on;
proxy_set_header X-Forwarded-Proto https;
proxy_redirect default;
proxy_redirect http://$host/ https://$host/;
proxy_redirect http://hostname/ https://$host/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_send_timeout 1200s;
proxy_read_timeout 1200s;
fastcgi_send_timeout 1200s;
fastcgi_read_timeout 1200s;
}
}
Any suggestions as to why this is occuring? Thanks