nginx

nginx not serving statics as part of page

I have a Mongrel cluster behind nginx and am trying to get nginx to serve up the static contents of my site with the following rule (RESTful URLs): location / { if (-f $request_filename) { break; } if (!-f $request_filename) { proxy_pass http://mycluster$request_uri; br...

Is there a solution that lets Node.js act as an HTTP reverse proxy?

Our company has a project that right now uses nginx as a reverse proxy for serving static content and supporting comet connections. We use long polling connections to get rid of constant refresh requests and let users get updates immediately. Now, I know there is a lot of code already written for Node.js, but is there a solution that le...

PHP FPM returns HTTP 500 for all PHP errors

I am running nginx with PHP-FPM. My nginx configuration for handling php files looks like this: location ~ \.php$ { set $php_root /home/me/www; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $php_root$fastcgi_script_name; include /etc/...

Using nginx/fcgi/django, I have form posts that give a 504 gateway time-out

I have an app that uses Django with FCGI on nginx. I'm using the third-party apps like James Bennett's django-registration and django-messages from the Pinax Project. Both of these apps have forms that are submitted and save data into the database, then redirect on to a new URL. My issue seems to be that the .save() method on any of the...

How to handle crossdomain.xml in django?

I'm running an an ubuntu vm - django is running under apache2 behind nginx I need to setup crossdomain.xml - currently getting 'access denied' etc when trying to play flash movs whats the best way to set this up? ...

Serving php files from different locations in nginx

I have my main website and wordpress in different directories on my server on which I use nginx as the web server. The main website is in /home/me/www and Wordpress is in /home/me/wordpress. I need to have them in separate directories this way for a particular reason. How do I specify this in the nginx configuration file? I currently hav...

Help with complex nginx rewrite rules for subdomains needed please

I currently have the following (hacky) re-write rule in my nginx.conf to allow dynamic sub-domains to be re-directed to one Django instance. set $subdomain ""; set $subdomain_root ""; set $doit ""; if ($host ~* "^(.+)\.domain\.com$") { set $subdomain $1; set $subdomain_root "/profile/$subdomain"; set $doit TR; } if (!-f $req...

Converting an ExpressionEngine rewrite rule for and NginX server

I'm trying to migrate a working ExpressionEngine installation from an Apache environment over to an NginX environment on a different box. I have come across a problem trying to convert some .htaccess rewrites to NginX. The site uses the multi language module so needs a custom rewrite rule for every additional language. This is my stand...

Nginx server matching too many URLs

Hello, I've got a domain example.com and an "alternative" of some-example.com. I'm trying to direct traffic from some-example.com to example.com using a simple server declaration in nginx as follows: server { listen 80; server_name some-example.com; rewrite ^/(.*) http://example.com/$1 permanent; } I'm not 100% sure if thi...

Amazon EC2 instance for Ruby on Rails + Thin + Nginx

Hi, I've been looking for an AMI that has basically an updated version of ruby gems, thin and nginx and mysql installed. EC2onRails seems to be left alone now since Paul decided to leave the project. If you were to deploy your Rails App in the cloud, what are your benchmarks? Recommendations? ...

Optimize Nginx + PHP-FPM for faster response times (for Openx adserving)

I'm currently running Nginx + PHP-FPM for serving ads on OpenX. Currently my response times are horrible, even during times of low load. However, my CPU and Memory resources are fine, so I can't seem to figure out what the bottleneck is. My current config for nginx and php-fpm is: worker_processes 20; worker_rlimit_nofile 50000; error_...

CherryPy behind Nginx reverse-proxy POST requests corrupted/truncated

I have put my application using Cherrypy 3.1.2 behind Nginx configured as a reverse-proxy. All is working right for GET requests, but all POST requests return HTTP 400 - Malformed header. I traced into CherryPy WSGI-Server source code to see the request-handling code and found out that if for GET requests the first request line correctl...

Rewrite rules for wordpress 3.0 (multi-site) for nginx?

This is the new version being used by wordpress... 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...

question about django+nginx+fstcgi

in our project, we are using chain, like in question title. i want to ask: is it any chance to disable "autocheck" server code by django-server on its change? ...

Best fast authentication mechanism for embedded devices with Nginx & Apache

Hello All, We have a project deployed with Nginx, Apache, Django and Postgres. The project has large number of embedded devices login in to the server(https) in 5 minutes intervals and send a file to the server. Also, the WebUI face of the project has normal users login in and performing different functions. Currently, system doesn't ...

Do you know of a NGiNX module that performs something similar to verification of Amazon Web Service request signatures?

I'd like to restrict access to my web service to registered clients. The first thing I thought of was to mimic that of AWS which, in a nutshell, issues clients a non-secret and secret key pair, and requires clients to prove knowledge of the secret key by using a cryptographic function of some of the HTTP request data and the secret key,...

Nginx proxy http PUT chunked to apache

Nginx doesn't support chunked requests so i'm tryping to proxy my PUT request to apache, but it seems nginx blocks and sends 411 error even when proxying. Any way I can get nginx to send those requests to apache untouched, as is? ...

Nginx Upload Progress Module with Rails and Passenger

I’ve been trying to get the Nginx upload progress module running on WebFaction with Rails and Passenger (using Paperclip to upload to S3). The best result I have come up with so far are that it reports on start and on finish, but nothing in between. The Ajax request to the /progress path is working fine. This is the nginx.conf file I h...

How to avoid nginx "upstream sent too big header" errors?

I'm running nginx, Phusion Passenger and Rails. I am running up against the following error: upstream sent too big header while reading response header from upstream, client: 87.194.2.18, server: xyz.com, request: "POST /user_session HTTP/1.1", upstream: "passenger://unix:/tmp/passenger.3322/master/helper_server.sock It is occuring o...

Reverse proxy Google App Engine and Google Accounts authentication.

I have requirements to run a "walled garden" wifi portal page that should be hosted on App Engine. Unfortunately, the captive portal software can only whitelist by IP, requiring that we setup a nginx server that reverse proxies to appname.appspot.com. The app also has authentication via Google Accounts. What is the best way to handle ...