nginx

Nginx: Rewrite file extension

Guys, How can i rewrite a .swf file extension?? This is my syntax which does not work: rewrite ^/directory/swift$ directory/tools/swift_file.swf last; ...

Why does nginx reverse proxy of ssl to apache causes endless redirects?

I have set up nginx to handle SSL requests and send them to Apache/mod_python as described in http://code.google.com/p/mango-py/wiki/SSLRedirect. I added the django Middleware. I do proxy_set_header in nginx as described in http://yuji.wordpress.com/2008/08/15/django-nginx-making-ssl-work-on-django-behind-a-reverse-proxy/. This is intend...

nginx - serve static content from a subdomain

Is there a way I can setup nginx to serve static content from static.example.com - without having to modify all my php files to reflect where to get the images from? I was hoping there was some trick I can do in the nginx conf files. ...

How to use nginx with PHP?

What is a good way of using PHP with nginx? From the finding I got, maybe using PHP-FPM might be a good way of handing PHP behind nginx. The problem we have is that the free web based API we serve gets a lot of request (about 500K a day), mostly the requests are very short and small in size but Apache is consuming a lot of memory. I wa...

Deploying django under a sub-URL with Nginx/Fastcgi

I can't for the life of me figure out how to deploy a django site under a non-root location with Nginx/fastcgi, e.g. http://localhost:8080/myproject/ instead of http://localhost:8080/; all the examples I have seen either assume Apache or mounting at the root of the site. Here's the relevant part of my nginx.conf: server { listen 808...

Is GridFS fast and reliable enough for production?

I develop a new website and I want to use GridFS as storage for all user uploads, because it offers a lot of advantages compared to a normal filesystem storage. Benchmarks with GridFS served by nginx indicate, that it's not as fast as a normal filesystem served by nginx. Benchmark with nginx Is anyone out there, who uses GridFS alrea...

Ajax not working on Nginx / Wordpress

ahoy, i'm running wordpress 3x on nginx and all my ajax calls are broken. the exactly same wordpress runs fine on Apache. i've fixed somehow an ajax call to work with nginx by removing 'index.php' from all jquery.post() calls, but i couldn't fix the other calls in the same way. basically the changes were: for nginx the line: jQuery.p...

Nginix directing to a host called "_"

I have nginx all set up for my needs... it's a wildcard directory based hosting setup. My issue is that when a url is given without an extension or trailing slash, nginx redirects it to a host called "_" with the rest of the URL intact. What can I do to make nginx properly redirect the urls without trailing slashes? ...

Apache and ultimate config for nginx to serve all virtual hosts in the right way

I've just set up nginx to serve static request on one site, but I have lots of sites on my server and I wonder, should I right new nginx server configuration for all of them? What I'm doing now. I have file with all virtual hosts entries for Apache with some-thing like this: NameVirtualHost *:8080 <VirtualHost *:8080> ServerName sky2hi...

Cherrypy : Do I really need to put it behind a frontend ?

Hi. I've been working on a python web app using cherrypy and read it'd be more "robust" to use it as a backend, so I gave it a try. Shortly put, running some benchmarks on a page doing some database operations and serving static & dynamic content has shown that plain cherrypy was twice as fast than nginx and memcached, and about half f...

Nginx+spawn-fcgi doesn't work with second IP

I can see html file,but when trying to visit a php file,I'll get a 404 error. but everything is OK,with first IP address, Why? ...

How does Nginx handle HTTP requests?

I understand thread driven that Apache uses: every connection opens up a thread and when the response is sent, the thread is closed, releasing the resources for other threads). But I don't get the event driven design that Nginx uses. I've read some basics about event driven design .. but I don't understand how this is used by nginx to h...

how can i configure nginx to drop requests on certain conditions?

how can i configure nginx to drop requests if it has photos-X-ak.fbcdn.net in the url.. and requests for a gif image ...

NGINX Setup (Rails App in a subdirectory)

I'm using NGINX with Passenger to run a rails application on an Ubuntu server. However, I'd like to have the rails app served from www.mydomain.com/store , and have a wordpress install served from www.mydomain.com. How would one go about setting up the nginx.conf? ...

nginx redirect HTTPS to HTTP

How can i redireect from https to http? i have the code below but it does not seem to work. server { listen 443; server_name example.com; rewrite ^(.*) http://example.com$1 permanent; } ...

When executing Perl with FastCGI wrapper in nginx, do I actually get a speed benefit?

Hi, I'm using nginx with this script as FastCGI wrapper, that I start with: spawn-fcgi -F 3 -u www-data -s /var/run/perl-fcgi.sock -P /var/run/perl-fcgi.pid -- ./perl-fcgi.pl Now, suppose I have a simple script: #!/usr/bin/perl print "Content-type: text/plain\r\n\r\n"; print "hello\n"; The script runs fine, and I see the "hello" w...

nginx + SslRequirement + mongrel cluster = infinite redirect loop

I'm getting an infinite redirect loop after adding SSL support to my site. I'm using the "SslRequirement" plugin. The symptoms I'm seeing are, any action that has "ssl_required" enabled, and any URL I type in manually that has https at the front, goes into an infinite loop, with the following in the development.log file, over and over u...

How do I dynamically add pylons apps to a uwsgi process on nginx with UWSGI_SCRIPT?

I have successfully deployed a single pylons app on nginx + uwsgi using: uwsgi --paste config:/var/www/sites/helloworld/development.ini --socket :3031 -H /var/www/virtualenv However I am using nginx to virtual host 3 sites. Based on this tutorial and the uwsgi/wiki/DynamicApps page from main uwsgi site on unbit, I can add apps dynami...

Rewrite Rules for Subdirectories in Wordpress 3 Multiuser with nginx?

My Wordpress 3 multiuser has been enabled, but I don't know how to rewrite the following .htaccess rules for nginx: RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # uploaded files RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-...

Multi Site Wordpress rewrite rules in Nginx

I'm trying to run a multi domain blog installation with Wordpress and Nginx. The last step is to configure some rewrite rules in .htaccess (apache only) for the webserver. How so I translate this into Nginx rewrite rules. RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] # uploaded files RewriteRule ^files/(.+) wp-include...