nginx

nginx - how do I get rewrite directives to execute before index directives?

I'm trying a simple internal rewrite with nginx to navigate to a sub-directory depending on the user_agent -- mobile browsers go to /mobile, otherwise they go to /www however it seems that when I rewrite these urls, the index directive is processed before the rewrites, so I end up getting 403 forbidden. # TEST FOR INDEX index index.php...

Cache only some directorys or extensions on nginx.

Dears, I had a problem. I´m using the php script calle SocialEngine and I´d like to use nginx to cache the static content. I have 2 otpions 1) Cache some dirs like /images/ , /templates/ , /include/css/ , /include/js/... etc 2) Caache some static files like: .css, .tpl, .js, .gif, etc... I prefer use the first option, but the second...

nginx + ssi + remote uri access does not work

I have a setup where my nginx is in front with apache+PHP behind. My PHP application cache some page in memcache which are accessed by nginx directly except some dynamic part which are build using SSI in Nginx. The first problem I had was nginx didnt try to use memcache for ssi URI. <!--# include virtual="/myuser" --> So I figured t...

How can i get the source of a 777 - CHMOD php file?

A moderator of a forum i own did so. I still can't belive on it, and i can't understand how he did it. Can someone explain me? He said he used only HTTP GET requests The moderator said that the server (nginx) would normally send the output of the executed php files, but since that the files are 777 adding some parameters to the URL he c...

nginx rule to serve root

I would like to nginx to serve a static file from website root ( : http://localhost:8080/ ) but it serves my proxy pass; it serves "/" rule instead of "= /". Here is what my nginx config look like : listen 0.0.0.0:8080; server_name localhost; set $static_dir /path/to/static/ location = / { # got index.html in /path/to/static/html/i...

Will an Nginx as reverse proxy for Apache help on dynamic content only

I am planning to move all my static content to a CDN so on my server I only have dynamic content left. I now have Nginx set up as reverse proxy to Apache. The static request that came in where directly delivered by Nginx without having to go to Apache. In this case Nginx handled a large portion of the request and I can clearly see the n...

Django: Serving Media Behind Custom URL

So I of course know that serving static files through Django will send you straight to hell but I am confused on how to use a custom url to mask the true location of the file using Django. http://stackoverflow.com/questions/2681338/django-serving-a-download-in-a-generic-view but the answer I accepted seems to be the "wrong" way of doing...

Dealing with multiple parameters in Nginx rewrite

I have a rewrite that nginx calls like so: location ~* (css)$ { rewrite ^(.*),(.*)$ /min/index.php?f=$1,/min/$2 last; } And it's used on pages like this: http://domain.com/min/framework.css,dropdown.css Works all fine and dandy, but it's not scalable. Adding another element to the URL means I have to directly edit t...

Tilecache standalone server with nginx in production environment

Hi, I am really new to tilecache. I would like to know how good is the tilecache http server that comes with the tilecache installation. Is it practical to deploy it behind nginx in production environment? (i.e. nohup tilecache_http_server.py -p 8000 & and then editting the nginx.conf). The VPS we are using has nginx installed already so...

nginx trailing slash issues

I'm googling a lot and found several workarounds, but you have to deinfe every single directory. On Apache: example.com/hi -> example.com/hi/ On nginx: example.com/hi -> Firefox can't establish a connection to the server at example.com:8888 where 8888 is what Apache is listening on (nginx's :80 -> localhost:8888) Any ideas how to fix ...

Lightweight HTTP application/server for static content

Hi, I am in need of a scalable and performant HTTP application/server that will be used for static file serving/uploading. So I only need support for GET and PUT operations. However, there are a few extra features that I need: Custom authentication: I need to check credentials against a database for each request. Thus I must be able ...

nginx-tornado-django request timeout

We are using nginx-tornado-django to provide web services. That is, no web page frontend. The nginx server serves as a load-balancer. The server has 8 cores, so we launched 8 tornado-django processes on every server. Memcached is also deployed to gain better performance. The requests per day is about 1 million per server. We use MySQL as...

Django: Unicode Filenames with ASCII headers?

I have a list of strangely encoded files: 02 - Charlie, Woody and You/Study #22.mp3 which I suppose isn't so bad but there are a few particular characters which Django OR nginx seem to be snagging on. >>> test = u'02 - Charlie, Woody and You/Study #22.mp3' >>> test u'02 - Charlie, Woody and You\uff0fStudy #22.mp3' I am using nginx as ...

Passenger problem: "no such file to load" -- /config/environment

I've been researching this one and found references to similar problems here and there, but none of them has led to a solution yet. I've installed passenger (2.2.11) and nginx (0.7.64) and when I start things up and hit a Rails URL, I get an error page informing me of a load error: no such file to load -- /path/to/app/config/environment...

Ruby on rails multiple apps hosting (name server)- configuration question

I am looking to host multiple ruby on rails apps and want to use lighttpd or nginx.How do I do multiple name server configuration. ? I know how to do it in apache through webmin control panel.But trying to move away from apache here ...

nginx_http_push_module and databases

i am a newbie of nginx , and i am using nginx as a comet server by nginx_http_push_module i have two question: 1,how can i save the messages which recieved by nginx_http_push_module into databases ? 2,how can i get listeners list of a channel ? thanks~ ...

nginx subdomain rewrite

Yet another nginx rewrite rule question How can I do a rewrite from http://www.*.domain.com to http://*.domain.com ? thanks in advance Deb ...

nginx + passenger not using rackup file

I have an issue where Passenger is not detecting the config.ru file for the following nginx server server { listen 80; passenger_enabled on; server_name callumj.com cjlondon.com; access_log logs/callumj.access.log; root /webapps/callumj_com/public; } Nginx just seems to ignor...

Redirect to a web server depending on location with nginx

Im working on a web site that has to be reachable from many countries under the same domain. Id like to know how can I receive a request with nginx (or any other static file server), and send it to different web servers depending on IP's location. I mean, what is the point on having multiple db machines on country A and B, if the serve...

Rails 3, Authlogic, NGINX and HTTP basic authentication no working nicely together

I am in the early stages of building an app using Rails 3. User authentication is powered by Authlogic which I have setup pretty much as standard (as per the example docs) and everything is working as expected locally. I have just deployed the app to a clean server install of Centos 5.4 / NginX / Passenger so staff can start to log in a...