Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've the following setup on my server:

server {
    listen test.myserver.com:8443 ssl;
    ssl_certificate      /etc/ssl/certs/test.myserver.com.chained.crt;
    ssl_certificate_key  /etc/ssl/private/test.myserver.key;
    ssl_protocols        SSLv3 TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers          HIGH:!aNULL:!MD5;
    location / {
        root /myuser/myapp/public;
        access_log off;
        expires max;
    location /urltoproxy/ {
      proxy_set_header Host $host;
      proxy_pass http://api.someserver.com?id=1;

proxy_set_header directive should preserve url

The root location works fine, but when I try this...


...I get this error:

400 CNAME not recognized

share|improve this question
Seems, what this answer is generated by backend (api.someserver.com?id=1). Try to debug backend without nginx to have information, what do you need to take for. It may want to get some additional headers, or whatever. Also post your nginx error_log please. –  unlo Jan 22 '13 at 9:09
Thank you very much @unlo it's definetely a backend problem. I have to investigate with backend developer. –  baffonero Feb 13 '13 at 12:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.