nginx consists of modules which are controlled by directives specified in the configuration file.
Simple Directives
A simple directive consists of the name and parameters separated by spaces and ends with a semicolon (;).
Block Directive
A block directive has the same structure as a simple direc...
You can check for syntax errors and referenced files in an NGINX configuration file before running it with:
nginx -t
Alternatively you can run service script
service nginx configtest
While both of these commands will tell you if your new nginx configuration is ok [without killing your curren...
Paste this snippet somewhere in the http {} Block; or place it in it's own file in the /etc/nginx/conf.d/ folder. Also see the official docs for logging to syslog.
#
# Access Log
#
log_format fmt_syslog '[$time_local] $status $remote_addr $http_host "$request" $body_bytes_sent $reque...
A usual Website just needs 3 HTTP Methods: GET, HEAD and POST. Block all other Methods by using limit_except:
location / {
[...]
# Note: GET includes HEAD
limit_except GET POST {
deny all;
}
[...]
}