nginx: [emerg] unexpected "}" in conf

Discussion in 'Nginx' started by skippyV, Aug 24, 2016.

  1. #1
    Hello,
    Can someone point out the unexpected brace please in my conf file?
    
    server {
        server_name mydomain.com www.mydomain.com;
        root /var/www/mydomain.com/public_html;
        listen 80;
       
        access_log /var/log/nginx/mydomain.com-access.log;
        error_log /var/log/nginx/mydomain.com-error.log;
       
        location / {
           
            index index.html index.htm
        }    
    
        location / {
            try_files  $uri $uri/ /index.php?$args;
        }
    
        location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
            access_log off;
            expires max;
        }
        location ~ /\.ht {
            deny  all;
        }
        location ~ \.php {
            try_files $uri = 404;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            include /etc/nginx/fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        }
    }
    
    Code (markup):
    thanks
     
    skippyV, Aug 24, 2016 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    You're missing an ending ; after index.htm
     
    PoPSiCLe, Aug 25, 2016 IP
    Arick unirow likes this.
  3. skippyV

    skippyV Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    Gaaahh! Thank you. I'm staring at the braces like a noob.
     
    skippyV, Aug 25, 2016 IP
  4. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #4
    Experience ;) The error-message is not always showing the real culprit. After checking all the braces, and not finding anything wrong, I just looked at the code immediately before it :)
     
    PoPSiCLe, Aug 26, 2016 IP
  5. huipark

    huipark Greenhorn

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #5
    You can go to nginxgenerator.com to create virtual host file easily!
     
    huipark, Nov 13, 2016 IP