nginx

Django and Nginx try_files problem for site root page

I use such Nginx configuration for the domain: server_name_in_redirect off; listen 80; server_name ~^(www\.)?(.+)$; root /var/www/$2/htdocs; location / { try_files $uri $uri/ $uri/index.htm @django; index index.html index.htm; } location @django { fastcgi_pass 127.0.0.1:8801; fastcgi_param PATH_I...

Should I user Apache or Nginx & Passenger or Mongrel for my Rails application

Hello, I have a Ruby on Rails application that will be a CMS in way which means it's mostly DB intensive. I expect it to have decent amount of traffic so before designing I'm choosing what servers to use. Most important for me is performance. I heard good things about Nginx and many developers in the Rails community recommends it my on...

What kind of performance gain will I get from ditching Apache for NGINX?

What kind of performance gain will I get from ditching Apache for NGINX if I have a very low traffic web site (e.g. 1000 unique visitors a day, approx 5 requests/sec at highest load, and approx 50 MB of traffic per day since lots of photos are being displayed). Specifically, what gains (if any) would I have for: Loading speed of the w...

What is meant by the Passenger-enabled Nginx error 'rack_env directive is duplicate'?

When we try to start Nginx, we see this error that prevents Nginx from starting. The error exactly is: "rack_env" directive is duplicate We have set rails_env and rack_env... does this conflict in some way? Any ideas what is meant by it? We can't find any meaningful documentation in the Nginx Passenger User guide nor in the source nor...

With nginx, can I redirect the user back to a URL on their local machine?

For a particular internal purpose I would like to send people back to a url on their own machine, how exactly would I do this? I can't really do server { server_name www.yayaya.com; rewrite ^(.*) localhost:3000$1 permanent; } because that will point to the server's localhost, right? ...

How to evaluate the performance of web servers?

I'm planing to deploy a django powered site. But I feel confused about the choice of web servers, which includes apache, lighttpd, nginx and others. I've read some articles about the performance of each of these choice. But it seems no one agrees. So I'm wondering why not test the performance by myself? I can't find information about ...

Django dynamic content in VPS environment - when do I need a queue?

I've got some Django content that I plan to host on a vps, web facing. It dynamically generates images that are cached to disk (regeneration is not often needed except (1)user changes content within image or (2) the layout is updated globally so all images need regeneration) right now when a user requests a view, it checks to see if what...

HTTP Basic Auth, reading password file and performance

hi, I'm curious to know what are the performance impacts of using HTTP Basic Auth on a webserver like Apache or lighttpd or nginx. I imagine the bottleneck is the actual reading of the file by the server to authenticate a user. It also seems to me that the cost of reading the file to authenticate a user is proportional to the number of ...

nginx with mod_wsgi

I generally run web apps behind nginx with FastCGI. I wanted to experiment with mod_wsgi, however it seems quite out of date. The author mentions that it worked on version 0.5.34, however I'm running 0.7.62 now. The wiki article warns of compilation problems with the module and later versions of nginx. Has anybody used mod_wsgi with ...

Nginx doesn't serve static

I'm running django on ubuntu server 9.04 Django works well, but nginx doesn't return static files - always 404. Here's the config: server { listen 80; server_name localhost; #site_media - folder in uri for static files location /static { autoinde...

Deployment Strategy using Nginx and Passenger

Hello, I need help with setting up nginx and passenger on two separate machines. Can anyone point me in the right direction? I've already finished setting up my nginx and now that I need to install passenger, Ive reached this road block and I'm not sure how to proceed. Thanks! ...

Is there a way to do pre-compression with on-the-fly-uncompression in nginx?

It's easy to use the pre-compression module to look for a pre-compressed .gz version of a page and serve it to browsers that accept gzip to avoid the overhead of on-the-fly compression, but what I would like to do is eliminate the uncompressed version from disk and store only the compressed version, which would obviously be served the sa...

Passenger with apache and nginx on the same development box

I've got Apache and passenger on my notebook. I want to test Nginx and passenger on the same machine. I can install Nginx on 8080 and apache on 80. But can I install passenger with both the same server on the same machine? ...

Drupal + Nginx + Php-cgi : 502 Bad Gateway error

We are running Drupal 5.x on Nginx with php-fastcgi. Things were working fine for a while. All of a sudden, we (users) are running into 502 Bad Gateway error. Restarting PHP-cgi, nginx.. rebooting machine etc did not help. Did anyone else run into this type of issue? What are the possible suspects? ...

Recommended EC2 AMI for high traffic PHP web service

I hope I'm asking this question in the right place. I have a web service serving widgets with about 500K hits /day. Traffic is expected to double monthly. It is currenty on VPS with Plesk 8 /Centos 5 / Apache 2/ Php 5.2.6 /Mysql 5.0.45 / Memcached / APC I'm seeing occasional kmemsize errors and also tcpbuff errors. To solve this I d...

mod_rails and Paperclip problem Paperclip::NotIdentifiedByImageMagickError

Hello, I am havingn troble deploying my app to a server runing ubuntu with mod_rails. Runing webrick on the server seems fine and I can save files, no problem. But runing the app thru nginx, I get this error when I try to save a file. [paperclip] An error was received while processing: # [paperclip] An error was received while processi...

Static files served from CIFS Windows share through nginx/Ubuntu aren't fully sent to the browser.

We have a Rails app with nginx front end. Users can upload files, which are stored on a Windows network share, and retrieve them later. The uploaded files are served statically through nginx. Downloading an image, for example, will only download a portion of the original image. Refreshing the page successfully downloads a little more of...

Nginx Rewrite rules for clean URLs ( problem with CSS and JS rendering)

I want to write nginx rewrite rules for clean URLs. Everytime the user hits http://domain.com/abc/12/16/abc-def-ghi I need to execute domain.com/abc.php?a=12&b=16&c=abc-def-ghi. Now my regex is right as per rubular: ^\/abc\/(\d+)\/(\d+)\/(\w+\S+)$ and rule is if (!-e $request_filename) { rewrite ^\/abc\/(\d+)\/(\d+)\/(\w+\S+)$ /abc.p...

Nginx rewrite for URI querystring value

I changed my website platform and i am now getting hits from google pointing to the old location of tag searches on my site. Basically i need to point: http://www.website.com/articles/Subject%3Alist=Music-Oldies&review_state=published to: http://www.website.com/tags/Music-Oldies ..in my Nginx website file. Only the tag 'Music-o...

Configure nginx to serve cached images

I have a Rails app which generates a lot of images; ie an images controller with a show action fetches an image from a SAN and serves it. I have a caches_page on this which reliably saves a copy of the file in a custom location; RAILS_ROOT + /public/cache. The files are there and look fine. I am serving the app through nginx and it seem...