Live data from Hacker News

Nginx for Developers: An Introduction

carrot.is

41–50 of 142 posts

Re: Nginx for Developers: An Introduction

#41

Earlier quoted context omitted.

I can't imagine there are many connections to worry about if you're configuring a new server.

Right but if you are modifying and existing server, then this needs to be taken into account. We have several servers who are constantly serving connections and we can't have any of them drop otherwise it will result in a poor user experience. I just wish the article talked about using reload as well as restart and when to use them.

Hi, author of the article here. I'm actually not familiar with reload, but after reading this comment thread I'm definitely going to read up on it and make sure it's reflected in the article. Any suggestions of knowledge you want to drop is more than welcome!

Re: Nginx for Developers: An Introduction

#43
post #10

I think the sites-available is a debianism, not present on all distros. One nice thing that nginx supports is include directives with wildcards so you can e.g. have /srv/example.com/nginx.conf and /srv/api.example.com/nginx.conf and include them in the main configuration file with include /srv/*/nginx.conf.

Yeah, I run nginx on both Ubuntu and RedHat boxes. On RedHat, the conf files go in /opt/nginx/conf ... there is no sites-avail/enabled

Re: Nginx for Developers: An Introduction

#44
post #33

What makes this "for developers"? Whats the difference if a sysadmin is reading this, or a Linux user? Im surprised to see this on the frontpage, it is less than basics in anything any hacker worth its name can do.

You're correct, the audience is really just a matter of semantics. The reason we wrote this post, knowing that this is very basic stuff, is that we found that a lot of the tutorials we'd come across didn't cover the introductory process end-to-end.

You're just as surprised as we are to see it on the frontpage!

Re: Nginx for Developers: An Introduction

#45
post #6

Earlier quoted context omitted.

Actually it's a very simple custom non-wordpress theme I put together in about an hour, the entire thing built on top of http://roots.cx dynamic content : ) Another note, the share button at the bottom (just pushed a minute ago so hard refresh if it's cached) is from this plugin we put together and have been enjoying so far: https://github.com/carrot/share-button Glad you enjoyed the article! Let us know if you run i…

I can't read the article on my Android phone because I can't resize it to fit on screen. So please remove the theme or fix it...

Oh man, I'm sorry! I totally dropped the ball on mobile - I'm going to push a responsive design right now. Sorry Justin!

EDIT: Updated, should work great on mobile devices now

Re: Nginx for Developers: An Introduction

#46
post #10

I think the sites-available is a debianism, not present on all distros. One nice thing that nginx supports is include directives with wildcards so you can e.g. have /srv/example.com/nginx.conf and /srv/api.example.com/nginx.conf and include them in the main configuration file with include /srv/*/nginx.conf.

I ran into a version of Nginx on CentOS had sites-avail/enabled.

Re: Nginx for Developers: An Introduction

#47
One of my favorite nginx features I just discovered is that you can use a regex in the server_name and then you can use the capture as a variable later [1] ... this lets you serve domains or subomains from completely different directories without a new conf file or a reload.

I'm using it at http://www.utterson.me to serve up static Jekyll blogs on a subdomain.

I may be wrong, but I don't think Apache can do this (it can do regex but you don't get a variable).

[1] http://nginx.org/en/docs/http/server_names.html#regex_names

Re: Nginx for Developers: An Introduction

#50
post #10

I think the sites-available is a debianism, not present on all distros. One nice thing that nginx supports is include directives with wildcards so you can e.g. have /srv/example.com/nginx.conf and /srv/api.example.com/nginx.conf and include them in the main configuration file with include /srv/*/nginx.conf.

I may be misunderstanding you, but sites-available and the conf files are usually two separate entities. sites-available | sites-enabled is analogous to using a2ensite in Apache without the automagic (you symlink yourself)

On systems that have both, yes, they're separate. But that separation is something the distribution does to help you organize your rules — to nginx, they're all the same AFAIK.
Post reply on HN