Live data from Hacker News

Nginx 1.6.0 stable released

nginx.org

31–40 of 114 posts

Re: Nginx 1.6.0 stable released

#31
post #5

I'm currently running apache 2.2.22 on my Ubuntu 12.04 servers. It works fine. I'll be moving them to 14.04 and thus getting apache 2.4.7. I mostly use it for mod_passenger webapps and static sites. 14.04 includes nginx 1.4.6 but I'm sure the phusion guys will package 1.6 soon so I can easily upgrade to that. Is there any killer feature in nginx that I'm missing, staying with apache 2.4?

(my) rule of thumb: unless there's no equivalent for an apache module you need, use nginx instead of apache. For balance, "Don't break what (apache) is working" applies too.

Re: Nginx 1.6.0 stable released

#32
post #27

Waiting for package for Ubuntu 12.04 and crossing my fingers that it comes with SPDY enabled so I don't have to compile it. I know, I am lazy :P.

you can use http://pilif.me/nginx.tar.bz2 to build a debian package from 1.6.0 that is built from the Ubuntu 12.04 source package, so it's a drop-in replacement.

Re: Nginx 1.6.0 stable released

#33

I figure this is as good of place as any to ask my question: Where can I find someone to hire that is able to write Nginx cofigs well. I have spent literally 40ish hours trying to create a Nginx conf that holds up to my OCD. I have been told numerous times on IRC that I am too picky and clean urls are a challenge to write. I am college student and System Administration isn't even my job! Help!

What problems exactly with "clean URLs" are you running into?

Re: Nginx 1.6.0 stable released

#34
post #22

I figure this is as good of place as any to ask my question: Where can I find someone to hire that is able to write Nginx cofigs well. I have spent literally 40ish hours trying to create a Nginx conf that holds up to my OCD. I have been told numerous times on IRC that I am too picky and clean urls are a challenge to write. I am college student and System Administration isn't even my job! Help!

Have you checked out https://github.com/h5bp/server-configs-nginx ?

also check out https://gist.github.com/plentz/6737338

Re: Nginx 1.6.0 stable released

#35

I figure this is as good of place as any to ask my question: Where can I find someone to hire that is able to write Nginx cofigs well. I have spent literally 40ish hours trying to create a Nginx conf that holds up to my OCD. I have been told numerous times on IRC that I am too picky and clean urls are a challenge to write. I am college student and System Administration isn't even my job! Help!

You should let your web framework of choice do that. You should be able to find any directives you need to add to your nginx conf in your framework's docs. Typically they will use a Front Controller (eg: app.php or index.php), so you need a directive to map all the dynamic traffic (ie. usually not images or other static files) to that file. Everything else is done by the framework.

Re: Nginx 1.6.0 stable released

#36
post #6

Earlier quoted context omitted.

Generally speaking, nginx is lighter/faster/less flexible (though no less powerful). It really shines on low-RAM VPSes where the RAM eaten up by a big list of httpd processes really adds up. For example, here are numbers from Apache+mod_passenger on my dev box: VSW RSS root 20050 0.0 0.1 416524 21020 ? Ss Apr18 0:13 /usr/sbin/httpd root 13370 0.0 0.0 217068 1984 ? Ssl Apr21 0:00 \_ PassengerWatchdog root 13373 0.0 0.…

Nginx is also non-blocking which is the main difference from Apache. I don't agree Nginx is less flexible, from my own experience it's quite the other way around - try configuring Apache as a reverse proxy, you'll see how "flexible" it really is.

Having managed a fairly complex apache based web site (lots of rewriting to maintain various legacy url schemes, a few cgi bin apps -- lots of cruft) -- I do think Apache is more flexible than nginx. Traffic server is probably more flexible still. On the other hand, you could say if you take a routing problem, and you attempt to fix it via mod_rewrite -- you now have (at least) two problems! ;-)

There was a fairly recent comparison between nginx and apache2.2/2.4 (and uwsgi and gunicorn, I believe) driven by jmeter for testing that showed apache was a little lower on throughput -- but more consistent on latency (unfortunately I can't seem to find the link again). So while I think it is generally good advice to "just use nginx", I wouldn't write off apache based on how 1.3 used to behave compared to old versions of nginx.

I would normally advice an architecture where you have a reverse proxy in front of application servers (even if that means php with fastcgi) if you can, and when it makes sense. Possibly with ssl termination and/or caching (varnish) in front of that. I'm not sure that using nginx is actually any better than, say, HAproxy -- unless you need a static webserver in addition to your appserver. As always YMMV -- choose the stack that fits your needs.

Re: Nginx 1.6.0 stable released

#37

I figure this is as good of place as any to ask my question: Where can I find someone to hire that is able to write Nginx cofigs well. I have spent literally 40ish hours trying to create a Nginx conf that holds up to my OCD. I have been told numerous times on IRC that I am too picky and clean urls are a challenge to write. I am college student and System Administration isn't even my job! Help!

You could pay the Nginx guys to help I suppose.

Re: Nginx 1.6.0 stable released

#38

I figure this is as good of place as any to ask my question: Where can I find someone to hire that is able to write Nginx cofigs well. I have spent literally 40ish hours trying to create a Nginx conf that holds up to my OCD. I have been told numerous times on IRC that I am too picky and clean urls are a challenge to write. I am college student and System Administration isn't even my job! Help!

You didn't really specify what you meant by clean URLs but, maybe this will be helpful to you or someone else.

I have a static site served via nginx, but I don't like seeing .html in the URLs.

It's a little tricky serving a static site without the .html extension because you may have a directory and an html page with the same name.

The way to deal with that is to actually use the .html extension in the file system but not URLs.

  location / {
    if ($uri ~ ^/google) {
      break;
    }
    if ($uri ~ ^/y_key_) {
      break;
    }
    if ($uri ~ \.html$) {
      return 404;
    }
    if ($uri = /index) {
      return 404;
    }
    if (!-f $request_filename) {
      rewrite ^/$ /index.html break;
      rewrite .* $uri.html break;
    }
  }

Re: Nginx 1.6.0 stable released

#39

I figure this is as good of place as any to ask my question: Where can I find someone to hire that is able to write Nginx cofigs well. I have spent literally 40ish hours trying to create a Nginx conf that holds up to my OCD. I have been told numerous times on IRC that I am too picky and clean urls are a challenge to write. I am college student and System Administration isn't even my job! Help!

What problems exactly with "clean URLs" are you running into?

It is a lot to get into now, but here is a taste.

foo.com/index > foo.com foo.com/ > foo.com foo.com/folder/index > foo.com/folder/ foo.com/bar.html > foo.com/bar foo.com/bar.htm > foo.com/bar foo.com/bar.php > foo.com/bar www.foo.com/ANY OF THE ABOVE TESTS > foo.com/*

other rules: Never add trailing slash unless it is an index file of a directory. Order: .PHP,.HTML,.HTM. Use h5bp/server-configs-nginx as a base. PHP-FPM should be fully supported and not exploitable by the foo.com/random.gif.php bug. 403 and 404 send to /404.html.

I am sure I am forgetting something, but that is a start.

Re: Nginx 1.6.0 stable released

#40
post #4

I wonder what is the policy regarding their Debian repositories now that 1.6 is stable (currently we have 1.4.x installed from that same repo). They broke some stuff in the past moving to 1.4 from an older release, it would be nice to have a "release notes" so we can check what can possibly go wrong (if anything). The changelog is huge, congratulations to the nginx team! EDIT: nginx twitter account confirmed that the…

I just upgraded one smaller site to 1.6 to test the waters before doing it elsewhere.

So far everything works as expected.

Post reply on HN