Live data from Hacker News

Nginx for Developers: An Introduction

carrot.is

91–100 of 142 posts

Re: Nginx for Developers: An Introduction

#92
post #87

Slightly off-topic, but I'm sad that people still use apt-get. aptitude is pretty much just better[1]. Also, if you're reading this article you probably don't need the slightly better performance/throughput of nginx. Nginx's configuration is just terrible. You can cause segfaults and all sorts of unexpected behavior with the If directive[2]. And who came up with the idea that rewrite[3] should sometimes redirect inst…

I'm extremely biased as I have been using NginX for many years now; however, I've got to completely disagree with you.

NginX's configuration is beautiful, elegant, and concise. It kicks the ever living crap out of configuring Apache or Lighttpd (the two other HTTPd's I have extensive experience with). It seems so strange, because it's different.

NginX's configuration language is declarative. If is imperative and actually using if inside locations in NginX creates an inner location and executes a mini language to process.

    14:42  !ifisevil
    14:42  please see above
Please see http://wiki.nginx.org/IfIsEvil for more about that in particular.

Finally, I have to disagree with OP... NginX has great documentation, written by Igor himself initially (and edited by the community) available here: http://nginx.org/en/docs/

Re: Nginx for Developers: An Introduction

#93

I've always wanted to use nginx to build web apps in Lua .. does anyone know/can recommend any great tutorials with this in mind? It'd be nice if I could learn how to use nginx+lua to build a blog, and so on .. I'll use google, but on the off chance someone on HN knows of something already, I'm all ears ..

You might be interested to know that NginX can even embed Lua internally as a scripting language in the configuration[1].

As for your goals of connecting NginX to serve your Lua project, well that's quite simple really. Unlike Apache or Lighttpd, NginX is not an application server. NginX is only a reverse proxying HTTP server that speaks HTTP, FastCGI, and UWSGI. To connect your Lua application to NginX, your Lua application will either need to speak HTTP, FastCGI, or UWSGI. I don't know anything about Lua so I can't really help you figure out which is best, but in terms of setting up with NginX, it mostly just changes which flavor of pass you will use.

[1]- http://wiki.nginx.org/HttpLuaModule

Re: Nginx for Developers: An Introduction

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

Today You Learn that is because the original package maintainer of the NginX package in Debian (and thus later, Ubuntu) simply copied the structure of the Apache package. It's most useless because there is no script to manage the sites available like with apache.

I have been complaining about this for years!

On FreeBSD and all my client's sites (whether they run Linux or what), I always set mine to include sites/*.conf and delete those apache-isms.

Re: Nginx for Developers: An Introduction

#96
This is fantastic, thank you! The way it's written is great because it doesn't treat me like an idiot (I get why books do that, but it can grow tiresome). I wish more tech books were written like this.

While we're picking nits, I thought this might be worth mentioning:

> The default port for the internet is 80

I'd change that to:

> The default port for the web is 80

Again, wonderful guide!

Re: Nginx for Developers: An Introduction

#97

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.

I instantly thought of your article when I saw this one. I also defended NginX's documentation and linked to the actual documentation, which I think most people forget exists over at http://nginx.org/en/docs/.

Re: Nginx for Developers: An Introduction

#98
post #14

For some strange reason I was expecting an article on nginx module development. http://www.evanmiller.org/nginx-modules-guide.html

You aren't at all alone. I was really hoping for updated module development information from someone currently in the trenches.

Re: Nginx for Developers: An Introduction

#99

If you like this article, I wrote a similar one called Devops for Dummies. http://tech.pro/tutorial/1335/devops-for-dummies-vps-configu... It teaches you how to setup a DigitalOcean (or any other) VPS from scratch to host N amount of Rails applications using Nginx and Passenger. It took me some time to get things working properly and I distilled it into this short article that holds your hand and takes you from A to…

You should probably have people use visudo instead of editing /etc/sudoers directly. If you make a typo or similar that prevents sudo from running correctly it will catch it.

Re: Nginx for Developers: An Introduction

#100

I've always wanted to use nginx to build web apps in Lua .. does anyone know/can recommend any great tutorials with this in mind? It'd be nice if I could learn how to use nginx+lua to build a blog, and so on .. I'll use google, but on the off chance someone on HN knows of something already, I'm all ears ..

There is an intro talk and slides from London Lua here http://www.londonlua.org/scripting_nginx_with_lua/index.html

It is pretty easy once you get started...

Post reply on HN