My NGINX configure redirect for HTTP to HTTPS. For the domain below, mailman.example.com = my actual domain
-NGINX config server { # EXTERNAL: Redirects all port 80 traffic to HTTPS listen 80 default_server; listen [::]:80 default_server; # server_name mailman.example.com; server_name mailman.example.com; # no issue for accessing from outside, it will redirect to https return 301 https://$host$request_uri; # Redirect http to https server_tokens off;
}
# INTERNAL: Listens ONLY on 127.0.0.1 to handle local HTTP requests server { listen 127.0.0.1:80; server_name localhost;
location / {
include uwsgi_params;
uwsgi_pass unix:/run/mailman3-web/uwsgi.sock;
uwsgi_param HTTP_HOST $host;
}
location /mailman3/static {
alias /var/lib/mailman3/web/static;
}
location /mailman3/static/favicon.ico {
alias /var/lib/mailman3/web/static/postorius/img/favicon.ico;
}
-The URL syntax https://mailman.example.com/mailman3/lists/list-id/confirm/?token=$token
-The error message when tried to add subscriber HTTP Error 400: HTTPSConnectionPool(host='localhost', port=443): Max retries exceeded with url: /postorius/api/templates/list/list-id/list:user:action:subscribe (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1029)')))
Please help!
Thanks, Marin