Live data from Hacker News

Nginx for Developers: An Introduction

carrot.is

51–60 of 142 posts

Re: Nginx for Developers: An Introduction

#51
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.

In my view, you answered your own question with the second sentence. Sysadmins and linux hackers are no doubt familiar with this stuff anyway and used to reading through sysops-style docs and wikis.

Many other developers, we assumed, would not be as familiar with ops at first, and would prefer more of a basic introduction that walks through the steps and explains things clearly.

Re: Nginx for Developers: An Introduction

#52
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)

It's distro-specific and it doesn't present by default in stock nginx.

Re: Nginx for Developers: An Introduction

#56

It's kinda depressing that this article is basically just a copy of one I wrote in 2010 and it's still something that gets attention as interesting stuff. Nginx documentation obviously still has a long way to go.

Hey mfjordvald,

We were not aware of your article at all, and if it's "basically a copy" it was entirely coincidental. I think the way you're looking at is very negative though -- any and all efforts to improve understanding of a great and powerful dev tool I think are a positive thing for the community.

I'd love to see your article too, could you link to it?

Re: Nginx for Developers: An Introduction

#57

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…

I've done something similar in Apache with mod_vhostalias, where you set a VirtualDocumentRoot that specifies the pattern to match against and the dynamic directory path to serve up.

Re: Nginx for Developers: An Introduction

#58
post #56

It's kinda depressing that this article is basically just a copy of one I wrote in 2010 and it's still something that gets attention as interesting stuff. Nginx documentation obviously still has a long way to go.

Hey mfjordvald, We were not aware of your article at all, and if it's "basically a copy" it was entirely coincidental. I think the way you're looking at is very negative though -- any and all efforts to improve understanding of a great and powerful dev tool I think are a positive thing for the community. I'd love to see your article too, could you link to it?

It's not your article that's depressing, it's the fact that nginx documentation hasn't come further than this over the years. Obviously there's still a need for even basic nginx information and there's absolutely no blame from me for filling that need. If anything I should blame myself for not marketing my own stuff more. :)

The article I mentioned can be found here: http://blog.martinfjordvald.com/2010/07/nginx-primer/

Re: Nginx for Developers: An Introduction

#59

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.

Me as well. I always use reload but I don't really know how it works. Does it maintain the old and new configs and drops the old after the last connection using it is complete?

Re: Nginx for Developers: An Introduction

#60
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.

He did mention specifically that the structure was provided by the `apt` install.
Post reply on HN