You are not logged in.
Hey guys, one quick question regarding nginx and its rewrite rules. Currently on the a recently setup server, with /srv/http as the document_root. I'm keeping it as the bare /srv/http/ so that I can do (domain)/wordpress or (domain)/owncloud etc etc at will, its simple, clean, direct. The only snag is if I just do (domain) I want it to default to the wordpress instance instead of a blank page.
I know Nginx can do something like this its rewrite rules, but im new enough to nginx that I'm not really sure on how to write them, in a way that would ONLY kick in if given a bare domain, and would leave all other variations, like (domain)/owncloud alone. I copied the server section of nginx.conf below, if someone could give me a hand that'd be awesome.
server {
listen 80;
server_name example.com;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /srv/http;
index index.html index.htm index.php;
}
It doesn't matter how much training you have. A broken rib is still a broken rib.
Offline
server {
listen 80;
server_name example.com;
}
Nginx takes the most specific fit first, so the bare domain name gets the rest
Offline