Ho nginx configurato per essere il mio server web visibile esternamente che parla con un backend su HTTP.
Lo scenario che voglio realizzare è:
- Il client invia una richiesta HTTP a nginx che viene reindirizzato allo stesso URL ma su HTTPS
- richiesta proxy nginx su HTTP al backend
- nginx riceve risposta dal backend su HTTP.
- nginx lo restituisce al client tramite HTTPS
La mia configurazione attuale (dove il backend è configurato correttamente) è:
server {
ascolta 80;
nome_server localhost;
posizione ~. * {
proxy_pass http: // backend;
proxy_redirect http: // backend https: // $ host;
proxy_set_header Host $ host;
}
}
Il mio problema è che la risposta al client (passaggio 4) viene inviata tramite HTTP e non HTTPS. Qualche idea?