First sorry for my poor english^^
I tried to set up a reverse proxy, and it work fine. Now i want to obtain a ssl certificate with letsencrypt and i failed^^
On the reverse proxy i creat a file 1234.txt to try connect to it.
I can connect to https://mysite/.well-known/acme-challenge/1234.txt, but i cannot on http://mysite/.well-known/acme-challenge/1234.txt i obtain an error 404.
Where i make a mistake on my nginx conf?
upstream [MySite].com {
server "[MySite].com";
}
server {
listen 80;
root /var/www/html/[MySite].com;
rewrite ^(.*) https://$host$1 permanent;
location ~/.well-known/ {
allow all;
}
}
server {
listen 443 ssl;
server_name [MySite].com;
ssl_certificate /etc/nginx/ssl/mysite.crt;
ssl_certificate_key /etc/nginx/ssl/mysite.depro.key;
proxy_redirect off;
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass https://X.X.X.X:8006;
proxy_buffering off;
client_max_body_size 0;
proxy_connect_timeout 3600s;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
send_timeout 3600s;
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;
proxy_set_header X-Forwarded-Proto $scheme;
}
location ~/.well-known/ {
allow all;
}
}
Thanks a lot for reply,
Regards,