Joren
Joren

Reputation: 9915

nginx reverse proxy to https?

This is my config:

server {
        listen 80;
        server_name prettylogs.com;
        return 301 https://$server_name$request_uri;
}

server {
        listen 443 ssl;

        server_name prettylogs.com;
        location / {
                proxy_pass  https://localhost:9200/;
        }
}

When I visit prettylogs.com, I do get redirected to https://prettylogs.com, however the request never reaches my node server from nginx. If I go to the port directly, the node server is running and displays.

Any ideas?

Upvotes: 0

Views: 462

Answers (2)

Joren
Joren

Reputation: 9915

Turns out that both ssl_certificate and ssl_certificate_key were required to get this working for me. I didn't see this mentioned anywhere, so there might be some setting which negates this, but this fixed it.

Upvotes: 1

Vimal
Vimal

Reputation: 21

There might be problem with your nginx conf file.

proxy_set_header   Host             $proxy_host;

it should have

proxy_set_header   Host             $host;

try with this updated configuration, your problem will be resolved.

Upvotes: 1

Related Questions