Skip to content

Instantly share code, notes, and snippets.

@pokle
Created August 21, 2015 03:45
Show Gist options
  • Save pokle/bf168803345cc799001b to your computer and use it in GitHub Desktop.
Save pokle/bf168803345cc799001b to your computer and use it in GitHub Desktop.
Minimal nginx configuration showing some basic things
# Save this as nginx.conf
# stop with: sudo nginx -s stop
# start with: sudo nginx -p . -c nginx.conf
events {
worker_connections 1024;
}
http {
server {
listen 80;
location /stuff {
root .;
autoindex on;
}
location = / {
return 302 http://localhost/hello/world;
}
location = /hello/world {
if ($arg_planet = "mars") {
return 200 "Hello martian";
}
add_header Set-Cookie "abc=123;Path=/;";
return 200 "Hello earthian";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment