nginx

passenger won't spawn more than 6 instances despite passenger_max_pool_size = 30

I have some problems with passenger + nginx and hope someone might be able help me and direct me in the right direction. I've set the passenger_max_pool_size to 30 but passenger never spawns more than 6 instances. I'm loading a webpage that uses ajax to load 30 sub pages from the server but because passenger only spawns 6 instances the...

Wordpress 3.0 conversion of .htaccess to nginx rewrite rules

RewriteEngine On RewriteBase BASE/ #uploaded files RewriteRule ^(.*/)?files/$ index.php [L] RewriteCond %{REQUEST_URI} !.*wp-content/plugins.* RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L] # add a trailing slash to /wp-admin RewriteCond %{REQUEST_URI} ^.*/wp-admin$ RewriteRule ^(.+)$ $1/ [R=301,L] RewriteCond %{RE...

Service php-fpm does not support chkconfig

Everything is working fine. Just that when i chkconfig –add php-fpm It throws me an error Service php-fpm does not support chkconfig php-5.2.13 php-5.2.13-fpm-0.5.13.diff.gz Below is the configuration i use ./configure --enable-fastcgi --enable-fpm --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --target=x86_64-redha...

Problem with setting cookies from Javascript running on nginx

I can't seem to set cookies from the jquery.cookies plugin when running on nginx. My configuration is pretty standard, I'm just wondering if anyone else has had the same problem. I'm new to nginx, so take it easy on me :) ...

PHP connection_aborted doesn't work with nginx?

I can't seem to get the function connection_aborted to work with nginx. The code I used to test is as follow: <?php ignore_user_abort(true); ob_implicit_flush(); $i = 0; while (!connection_aborted()) { echo $i; $i++; sleep(1); } file_put_contents('test',$i); In Apache, it works correctly, although it delays a little. i.e. ...

nginx multiple domain virtual host configuration

I'm setting up nginx with multiple domain or wildcard support for convenience sake, rather than setting up 50+ different sites-available/* files. Hopefully this is enough to show you what I'm trying to do. Some are static sites, some are dynamic with usually wordpress installed. If an index.php exists, everything works as expected. I...

On-Demand thumbnail creation with django and nginx

I want to generate thumbnails of images on the fly. My site is built with django and deployed using nginx which serves all the static content and communicates with django/apache using reverse proxy. Right now, for every image in my site, I generate all required sizes of thumbnails on-hand and deliver them when required. The problem is...

Server-side auto-minify?

Is there any way to automatically minify static content and then serve it from a cache automatically? Similar to have mod_compress/mod_deflate work? Preferably something I could use in combination with compression (since compression has a more noticeable benefit). My preference is something that works with lighttpd but I haven't been ab...

ngnix to proxy server B only if got 404 on server A

I'm trying to configure nginx (0.7.65) so it'll proxy to server A, and if it gets 404 will try to proxy to server B. I've tried the following, but it doesn't work. Any ideas? server { error_log /tmp/nginx.error.log; access_log /tmp/nginx.access.log; listen 4433; server_name localhost; location / { pr...

Is node.js ready for production use?

Starting a new project. It's basically a blogging/commenting system. We're considering node.js as the back end server. Is node.js ready for this sort of thing or is it too early and experimental? We need HTTPS and gzip compression - perhaps a front end nginx server could provide this? What's missing from node.js that would make devel...

What language are nginx conf files?

I'm not sure if I'm just missing something obvious here but I can't seem to find it on the tubes, I want to write some more robust conditions but I'm not sure sure of the syntax. for example is it possible for me to have an unless condition? ...

Nginx redirect if cookie present

I've seen some limited resources on checking for cookies with Nginx, but I couldn't really find the answer I was looking for, hopefully some of you Nginx masters can give me a hand. Essentially I have a vhost that I'd like to redirect to a different domain unless the user has a cookie, here is what I've created: server { listen 80; ...

Nginx syntax problem '~*'

I have at condition checking to see if user has a cookie like this: if ($http_cookie ~* "developer=true" ) { ... } I'm not familiar with the ~* syntax, I assume that that means if it 'contains', but what about the opposite? like what if I wanted to check if $http_cookie doesn't contain that cookie? ...

Why use nginx with Catalyst/Plack/Starman?

I am trying to deploy my little Catalyst web app using Plack/Starman. All the documentation seems to suggest I want to use this in combination with nginx. What are the benefits of this? Why not use Starman straight up on port 80? ...

Does nginx strip custom request headers?

In my nginx.conf I have this line in my server {} section: log_format debug 'header: "$http_x_myapp" cookies: "$http_cookie"'; Then if I do curl -H "X_MYAPP:test" -H "COOKIE:yay" localhost I get something like this in my access log: header: "-" cookies: "yay" Does anyone know why nginx is throwing away the X_MYAPP header? ...

How do I debug a HTTP 502 error?

I have a Python Tornado server sitting behind a nginx frontend. Every now and then, but not every time, I get a 502 error. I look in the nginx access log and I see this: 127.0.0.1 - - [02/Jun/2010:18:04:02 -0400] "POST /a/question/updates HTTP/1.1" 502 173 "http://localhost/tagged/python" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1....

github url style

Hi all, I wanted to have users within my website to have their own URL like http://mysite.com/username (similar to GitHub, e.g. my account is http:// github. com/sr3d). This would help with SEO since every profile is under the same domain, as apposed to the sub-domain approach. My site is running on Rails and Nginx/Passenger. Current...

HTTP New location after download starts

Hi I'm using X-Accel-Redirect (so implicitly nginx), Content-Type and Content-Disposition to download a file, everything works great. What I need to accomplish is redirecting to a new location after the download starts. I've tested with both Refresh and Location, it doesn't work. Is it possible with HTTP 1.1/nginx? Addendum I am loo...

Multiple Ruby versions on one webserver?

The Ideal Using rvm, it would be awesome to be able to have multiple Rubies on one webserver, and through some sort of server configuration, be able to assign Ruby versions to different Rails/Sinatra/etc apps on a per-project basis. I am aware, from rvm's documentation, that Passenger only works with one Ruby at a time. :( The Comprom...

nginx with passenger

Hello, I'm trying to move from Apache + Passenger to Nginx + passenger on my Ubuntu Lucid Lynx box. When I install passenger, sudo gem install passenger and cd /var/lib/gems/1.9.1/gems/passenger-2.2.14/bin sudo ./passenger-install-nginx-module everything is fine (no error). Nginx is downloaded / compiled and installed at the same ...