I have a config with a reverse proxy, basic authentication and SSL certificate from Certbot. When I try to connect to the domain, I get the error to many requests and see in the network tab that the login is repeating a lot. I tried the same for a different web app, were it worked perfectly (Dynmap). The thing I am trying to host is player analytics plugin for spigot, I can connect to the web app without nginx.
server {
server_name plan.domain.net;
location / {
auth_basic "Password Required";
auth_basic_user_file /home/ubuntu/nginx_password/.htpasswd;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8804;
proxy_redirect off;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/plan.orcraft.net/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/plan.orcraft.net/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = plan.domain.net) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name plan.orcraft.net;
return 404; # managed by Certbot
}