Documentation Shortcuts in Nginx

Nginx is simple to use, yet a powerful web server. If you'd like to search through its official documentation for a term that you couldn't understand or just wanted to learn the syntax of a keyword, you don't have to search through the entire Nginx documentation site. Instead, you could use the shortcut https://nginx.org/r/keyword . … Continue reading Documentation Shortcuts in Nginx

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

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