nginx: [emerg] unexpected end of file, expecting “;” or “}” in filename:linenumber

I created a new vhost for a domain to serve static files. Here's the config...   server { server_name static.example.com; root "/path/to/static.example.com/public; index index.html; access_log /var/log/nginx/static.example.com-access.log; error_log /var/log/nginx/static.example.com-error.log; location / { try_files $uri $uri/ /index.html; } } It can't get simpler than this. However, when I checked the configuration with `nginx -t`, it threw the … Continue reading nginx: [emerg] unexpected end of file, expecting “;” or “}” in filename:linenumber

Advertisements

Correct Nginx try_files syntax with query params

With WordPress sites and Nginx servers, you may have used one of the following try_files directives... try_files $uri $uri/ /index.php; try_files $uri $uri/ /index.php?$args; Both are incomplete. With the first method, arguments are not passed. With the second method, question mark is present, even when there are no query parameters. A complete solution is to … Continue reading Correct Nginx try_files syntax with query params

nginx error: (99: Cannot assign requested address)

Ref: http://stackoverflow.com/a/13141104/1004587 With Amazon EC2 and elastic IPs, the server doesn't actually know its IP as with most any other server. So you need to tell your linux to allow processes to bind to the non-local address. Just add the following line into /etc/sysctl.conf file: and then reload your sysctl.conf by: which will be fine on reboots.