nginx

How to tell gzip_static not to look for image files?

I have nginx installed with gzip_static activated. It works fine for CSS and JavaScript files, but it also looks for gzipped versions of image files like .png and .gif, although these are not in the list of files to be compressed: # strace -p 25044 2>&1 | grep gz open("/var/www/css/ymax.css.gz", O_RDONLY|O_NONBLOCK) = 438 open("/var/www...

SSL Handshake negotiation on Nginx terribly slow

I am using Nginx as a proxy to 4 apache instances. My problem is that SSL negotiation takes a lot of time (600 ms). See this as an example: http://www.webpagetest.org/result/101020_8JXS/1/details/ Here is my Nginx Conf: user www-data; worker_processes 4; events { worker_connections 2048; use epoll; } http { include ...

uWSGI + Django + Virtualenv unable to pick up _functools (import error)

OK, So I have tried this with & without a virtualenv: uwsgi --home /home/auston/new_proj/ --socket /tmp/uwsgi2.sock --chmod-socket --module app_wsgi --pp /home/auston/new_proj/nikeshere --logto /tmp/uwsgi.log --master --processes 4 -P Pretty much no matter what, I get this: *** Starting uWSGI 0.9.6.5 (32bit) on [Thu Oct 21 08:05:44 2...

php redirect not working with Nginx

Simple problem: I have conditions in php like so: if (!$authorized) show_site_404(); or like so for that matter if (!$logged_on) show_login_page(); These are obviously toll gates so that we don't have trespassers into parts of the system where only a specific user or only those that are logged on should be able to go. The ...

Django nginx and append slashes problem

I am trying to use nginx as a simple load balancer for django per Jacob Kaplan-Moss' example: http://github.com/jacobian/django-deployment-workshop http://python.mirocommunity.org/video/1689/pycon-2010-django-deployment-w If I stop nginx and have apache listen on port 80 everything works fine. If I have apache listening to nginx my ur...

nginx + fastCGI + Django - getting data corruption in the responses sent to the client

I am running Django behind nginx using FastCGI. I have discovered that in some of the responses sent to the client, random data corruption is occurring in the middle of the responses (might be a couple hundred bytes or so in the middle). At this point I have narrowed it down to either being a bug in either nginx's FastCGI handler or Dj...

NginX Friendly PHP Framework

Hey Guys, I'm looking for a PHP framework that, if I'm lucky, just works in nginx under FastCGI, otherwise, one that doesn't take too much tweaking. ...

what's the best way to maping /newyork to /area.jsp?id=1 ?

now,i using http://xxx.com/area.jsp?id=1 i want create a maping path http://xxx.com/newyork maping to /area.jsp?id=1 how to do is best? BTW:i using Resin(java) + Nginx ...

nginx and Perl: FastCGI vs reverse proxy (PSGI/Starman)

A very popular choice for running Perl web applications these days seems to be behind a nginx webserver proxying requests to either a FastCGI daemon or a PSGI enabled webserver (e.g. Starman). There have been lots of question as to why one would do this in general (e.g. http://stackoverflow.com/questions/2939393/why-use-nginx-with-catal...

regular expresssion to match something and not match something

I want an nginx location directive that would match all urls with "xyz" and not match ".php" I tried this location ~* /(.*)xyz/(.*)(?!\.php)(.*)$ {} but for example it always seem to match both /xyz/1 and /xyz/1.php but it should have matched only /xyz/1 ...

Issue with Passenger - Apache

Hi, Running in a Linode slice with Ubuntu 10.04 LTS. I am getting a 500 Internal Server Error. The Apache log has: Apache/2.2.14 (Ubuntu) Phusion_Passenger/2.2.7 configured -- resuming normal operations caught SIGTERM, shutting down * Passenger could not be initialized because of this error: The Passenger spawn server script, '/usr/...

Why does Passenger 3.0 with nginx crash on startup(?) then 403s?

On Ubuntu with REE 1.8.7, with nginx 0.8.53 manually compiled with the Passenger 3 module doc installed as per the docs, I get an error in the nginx error log when nginx starts: Unable to start the Phusion Passenger watchdog because it encountered the following error during startup: Unable to start the Phusion Passenger logging agent: a...

Nginx and passenger 3.0.0 on mac - why does it fail on startup?

I've been trying to set up nginx 0.8.53 and passenger 3.0.0 on my dev environment - osx snow leopard and REE. I manually compiled nginx with the passenger module linked in. When I tried running passenger, it had a problem - ENV['PATH'] appeared to be null, so the split on it when call PlatformInfo.find_command raised an exception. It ...

nginx rewrite question

Hi, I'm new to nginx and I got a rewrite problem here: I want to permanently redirect http://domain1.com/abc.php to http://domain2.com, but I want to keep http://domain1.com/abc.php?param=value, I've tried put rewrite ^/abc\.php$ http://domain2.com last; which works for http://domain1.com/abc.php, unfortunately it rewrites everythi...

Setting up django for the first time

I'm used to setting up a server for nginx with php and mysql. I understand that just fine. But I'm extremely confused at where to even start with django. I know nothing about python by the way. I'm running ubuntu 10.04 Python is already installed (not sure what version though. I read I need less than 3 or something) So firstly, how do...

How to detect X-Accel-Redirect (Nginx) / X-Sendfile (Apache) support in PHP?

Hi All, About Application I am working on an e-commerce application in PHP. To keep URL's secure, product download links are kept behind PHP. There is a file, say download.php, which accepts few parameter via GET and verifies them against a database. If all goes well, it serves file using readfile() function in PHP. About Problem Now...

django and nginx - urls are all the same

Right now, any url just brings up a project default page ("welcome to django"). No matter what I put (example.com, example.com/hello, example.com/asdfjkasdf(&$(#$$#) I'm new to django and am following a simple tutorial. My nginx.conf has this: location / { # host and port to fastcgi server ...

Writing Flex 3 ByteArray deflate algorithm

I come into a trouble implementing a Flex 3.0.0 client that receives compressed HTTP body from server via a socket HTTP library (not class HTTPService ). First it seems that nginx supports ONLY gzip compression with gzip on;. (Correct me if I'm wrong.) So, add HTTP header of Accept-Encoding: gzip to request. Then I get a compressed By...

php development on a Mac, I have nginx already installed, what else do I need?

I have nginx installed (was using it for Ruby on rails with passenger). What do I need to get this to work for PHP now? ...

add unique id to requests forwarded from nginx reverse proxy

Hi, We are running nginx as a reverse proxy that forwards requests to a Clojure application running Compojure, a library that wraps around Jetty and provides our application with the ability to service web requests. We currently capture logs generated by both nginx and the Clojure application (via log4j to syslog). We are unable, howev...