0

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?

3
  • BTW, is there any reason to have SSL overhead in localhost connections? Commented Dec 23, 2014 at 6:10
  • Not that I can think of. My issue is that I'm using nginx to replace a simple node proxy, and my proxy before handed the ssl stuff off to my main express app. Since nginx is handling the ssl itself, I should probably switch my express app to not use ssl, yeah? Commented Dec 24, 2014 at 7:15
  • It depends. May be ssl overhead doesn't worth efforts to remove it. Commented Dec 24, 2014 at 7:31

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Tried that. No change. Here's my nginx.conf file: gist.github.com/Jorenm/7b918c303ff2f71952c2
1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.