Related to my question about how to setup a reverse proxy using nginx, I am now stuck when setting up one which additionally requires a SSL connection.
I have docker container which provides the mapped SSL-port 4430 to my host-stystem. The webserver is using a self-signed certificate.
In my /etc/hosts
file, I have defined:
127.0.0.1 app.local
And my nginx server config looks like:
server {
listen 80;
server_name app.local;
location / {
return https://$host$request_uri;
}
}
server {
listen 443;
server_name app.local;
location / {
proxy_pass https://127.0.0.1:4430;
}
}
When I access my webapp using https://127.0.0.1::4430
it works fine. I get a warning about the certificate the first time though, which I then have to allow.
Yet when connecting to it via either http://app.local
orhttps://app.local
, my browser shows a:
SSL connection error
ERR_SSL_PROTOCOL_ERROR
I also was expecting for the certificate warning to appear which I then could allow.
How to get the reverse proxy working when using SSL with nginx?