This is my first time using nginx and I'm having some problems configuring an nginx.conf file. What I have is
server {
location ~ /(application|system) {
deny all;
return 404;
}
rewrite ^(.*)$ /index.php/$1 break;
}
In case it's not clear; I'm trying to block access to the directories application and system and rewrite all other requests to the index.php. I've tried validating the nginx.conf file using: ian@ubuntu:~$ sudo nginx -t -c path_to_conf_file
but get [emerg]: unknown directive "server"...
. Any ideas what I might be doing wrong?
You need to make sure the server directive is inside of the http directive if I recall.
eg:
http {
//various nginx settings here
server {
//server stuff here
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With