0

My problem is: going to https://{www,whatever}.mysite.com I got error 500. going to http://mysite.com works fine

upstream my_server { server unix:/webapps/server/run/gunicorn.sock fail_timeout=0; } server { listen 80; server_name site.com www.site.com; return 301 https://$server_name$request_uri; } server { listen 443; server_name site.com *.site.com; ssl on; ssl_certificate /etc/nginx/ssl/ssl.crt; ssl_certificate_key /etc/nginx/ssl/ssl.key; location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; if (!-f $request_filename) { proxy_pass http://my_server; break; } } } 

Please advise.

5
  • So what was in the error log? Commented Jan 15, 2014 at 16:09
  • nothing - this is the most interesting... I only see get 500 in access.log Commented Jan 15, 2014 at 16:27
  • Check your application, then. Commented Jan 15, 2014 at 16:31
  • Aplication is ok. Commented Jan 15, 2014 at 16:43
  • nothing in error.log ? Commented Jan 17, 2014 at 6:13

2 Answers 2

0

change server_name site.com *.site.com;

to server_name .site.com;

according to nginx doc

Wildcard names

A special wildcard name in the form “.example.org” can be used to match both the exact name “example.org” and the wildcard name “*.example.org”.

2
  • 1
    this solution didn't help Commented Jan 15, 2014 at 16:29
  • it was worth a try, if you have no other logs sorry, i have no further idea. Commented Jan 15, 2014 at 16:36
0

Sounds like the problem may be on your backend handling the extra domains.

Maybe hardcode the original domain, prior to passing the request to the backend?

 proxy_set_header Host site.com; 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.