Live data from Hacker News

Nginx for Developers: An Introduction

carrot.is

131–140 of 142 posts

Re: Nginx for Developers: An Introduction

#131

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 ap…

Thanks for the reply - I am definitely learning a lot from this feedback, and appreciate the effort.

Re: Nginx for Developers: An Introduction

#132

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

Check out Lapis - http://leafo.net/lapis/ and OpenResty which is what lapis is built upon http://openresty.org/

Looks like I'll be studying Lapis for the next few days - great stuff, thanks for the recommendation!

Re: Nginx for Developers: An Introduction

#133

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

Great - that looks like exactly what I need to get myself educated on the subject - really appreciate the great response, thank you!

Re: Nginx for Developers: An Introduction

#134
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/*.c…

You know how many times I had to restart the nginx daemon on a VPS for me to figure this out. Thank you for complaining!

Re: Nginx for Developers: An Introduction

#135
post #23

> The default port for the internet is 80, so if there’s no port in a url, that means it’s 80. The Internet has no default port; 80 is for HTTP. If the port is omitted, then the default for the scheme[1] is assumed. [1]: https://en.wikipedia.org/wiki/URI_scheme

haha fair enough, if I changed "the internet" to "http" would that satisfy you?

Yes, that would be good to change it to "http" to be clear about the protocol you are talking about. :-)

Re: Nginx for Developers: An Introduction

#136
post #86

Earlier quoted context omitted.

One thing I would recommend is searching for deals on LowEndBox[1] blog. Most of the popular VPS's are ridiculously overpriced compared to what you can find on LowEndBox. It's a good site to get advice and reviews of various VPS providers, too. [1] - http://www.lowendbox.com/

LowEndBox is great for non-mission critical servers. You aren't going to find many top tier providers on there, mostly smaller companies. I got a dedicated box (quad Xeon, 24GB RAM, 500GB) for $49/m.

I would love to get my hands on one of those. What provider did you get it from?

Re: Nginx for Developers: An Introduction

#137
post #112

Earlier quoted context omitted.

Yes, I linked to IfIsEvil. The fact that you need a page to document the horrible behavior because it's too late to fix it is a sign that something is very wrong with the config syntax.

The fact that you think it is a problem with the configuration syntax is an indication that you didn't read the wiki page, or the important part of my comment. NginX's configuration is declarative . The reason the imperative if was given powers beyond its means was because people clamored for the feature. The reason it's still there is because removing it would break some working configurations that use if . If you d…

I'm rather annoyed that you're not reading anything I've said.

No, the problem is not that I haven't read the page. I have. It can cause segfaults. Your configuration can cause segfaults. Your configuration can cause segfaults. Your configuration can cause segfaults.

And yes, I acknowledged that they can't remove it because it's too late, using those exact words. That doesn't mean it's not a problem. It means you should jump ship to something saner, like lighttpd, which also doesn't have the rewrite-sometimes-redirects problem.

Re: Nginx for Developers: An Introduction

#138
post #107

Earlier quoted context omitted.

Disabling root login without changing to using ssh-keys for authentication doesn't really buy you a whole lot of security; you can still access the box and root with knowing just one password -- the only thing you've avoided are brute force attempts against the root account. With sudo and only keys based access, the attacker will need to get a copy of the key (barring any new problems with key generation, like the De…

What does visudo do that nano -w doesn't? I've never understood this properly.

http://manpages.debian.net/cgi-bin/man.cgi?query=visudo

Re: Nginx for Developers: An Introduction

#139
post #86

Earlier quoted context omitted.

One thing I would recommend is searching for deals on LowEndBox[1] blog. Most of the popular VPS's are ridiculously overpriced compared to what you can find on LowEndBox. It's a good site to get advice and reviews of various VPS providers, too. [1] - http://www.lowendbox.com/

Why would anyone need to search LowEndBox, when they can get top tier cloud servers from DigitalOcean(which is linked on the original post)? There is absolutely no reason to use providers from LowEndBox with grandma's SolusVM, when you can spin up a server with DO anytime you want and pay by the hour? And not to mention, how these providers are ddosing and hacking one another regularly.

Not all providers there are bad; BuyVM is one that has treated me excellently

Re: Nginx for Developers: An Introduction

#140
post #137

Earlier quoted context omitted.

The fact that you think it is a problem with the configuration syntax is an indication that you didn't read the wiki page, or the important part of my comment. NginX's configuration is declarative . The reason the imperative if was given powers beyond its means was because people clamored for the feature. The reason it's still there is because removing it would break some working configurations that use if . If you d…

I'm rather annoyed that you're not reading anything I've said. No, the problem is not that I haven't read the page. I have. It can cause segfaults. Your configuration can cause segfaults. Your configuration can cause segfaults . Your configuration can cause segfaults. And yes, I acknowledged that they can't remove it because it's too late, using those exact words. That doesn't mean it's not a problem. It means you sh…

> Your configuration can cause segfaults.

MY configuration never causes segfaults, because I understand the declarative nature of the configuration language, and I don't mistakenly attempt to shoehorn imperative constructs into it.

By your logic, software should not be written in C/C++, because it can cause segfaults!

> It means you should jump ship to something saner, like lighttpd,

Ah, you're a lighttpd guy. I'll stick with not having the http server also be an application server, and we'll agree to disagree.

Have a nice day.

Post reply on HN