Created
August 21, 2015 03:45
-
-
Save pokle/bf168803345cc799001b to your computer and use it in GitHub Desktop.
Minimal nginx configuration showing some basic things
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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