nginx

nginx fails to start

We are running into the following error when we try to start Nginx (on Ubuntu) "" Starting nginx "/usr/local/nginx/on" "No such file or directory" "" It started showing up all of a sudden. Did anyone run into this scenario? Any pointers? Thanks in advance ...

How to serve all existing static files directly with NGINX, but proxy to Apache the rest?

location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; if (-f $request_filename) { access_log off; expires 30d; break; } if (!-f $request_filename) { proxy_pass http://127.0.0.1:8080; # A...

nginx not setting expires headers on Rails static assets

I can't seem to get nginx to set expires headers on my static assets in my Rails app. My app is deployed using Phusion Passenger & nginx. Below is the related section of my nginx config file server { listen 80; server_name my.domain.tld; root /home/deploy/my.domain.tld/current/public; passenger_enabled...

Nginx (as front end to Apache) to serve WP Super Cache static files

Hi all, I am currently working on my Wordpress blog, which is hosted on a VPS.NET VPS with Nginx as front end to Apache to serve static files, while Apache takes care of the PHP in FastCGI. This seems to be working great, however I haven't yet managed to have Nginx serve WP-SuperCache files as well, which I would like for maximum perform...

nginx rewrite not working (with passenger on Mac OS X)

I have nginx with rewriting working correctly on my server in production. But when I tried to set the same rule on my local development machine (mac) the rewrite doesn't seem to be working. I want "universitytutor.local" to redirect to "www.universitytutor.local" Here is the relevant part of my nginx.conf server{ listen 80;...

nginx proxy_pass weird url escaping ? (try it)

The original URL is: http://www.sitmo.com/gg/latex/latex2png.2.php?z=100&eq=%5Ccos%20%7Bx%7D%2B%5Csin%20%7Bx%7D%3DCV For some sandbox flash security reason i need to create a proxy on my domain, location /latex_gen/ { proxy_pass http://www.sitmo.com/gg/latex/latex2png.2.php?z=100&eq=; } Which now points to h...

Rails page caching with Apache and capistrano

The following post explains about the page caching in rails with Nginx. http://blog.hasmanythrough.com/2008/1/30/segregated-page-cache-storage I like to implement this solution with my app but on Apache. So, the main block/route is if (-f $request_filename) { break; } if (-f /cache$request_filename) { rewrite (.*...

handling large uploads on django, exceeding the max size on nginx

we have a django app on nginx where users upload media files. the media are huge such as 30min tv and radio programs resulting 100-300mb, and our shared hosting limits the upload to 30mb. how to embed a smart uploader which will put chunks of 20-30mb instead of trying to upload the large file? we would like not to destroy our highly edi...

Serving Large Files Through Nginx via Rails 2.3 Using x-sendfile

Let's say I have a Rails 2.3.2 application fronted by nginx and served by mongrel in which I need to serve a large static file through Rails (to control access to it). I want the Rails app to delegate the transfer of the file to nginx, to avoid blocking the mongrel instance. The available information seems contradictory and incomplete. ...

Hide X-Powered-By (nginx)

So is there any way to hide X-Powered-By on Nginx? ...

LightHttpd vs Nginx

Ok, I have seen this question quite a few times here on SO and as well as elsewhere on the web. But..they are all pretty old, so I will post it again. I have the following needs: Ability to handle lots of simultaneous HTTP connections (like comet). This is the reason I am looking at other webservers rather than apache. Should be easy ...

How to remove "X-Runtime" header from Nginx/Passenger?

EDIT -- the solution I posted below probably applies to any server (Nginx/Apache/anything else), because this header is set in Rails itself. Anyone know where the "X-Runtime" header can be removed in Nginx & Passenger? I've grepped the source files and haven't found anything yet, but I'd like to get rid of it for security since it's ...

Nginx and proxy to avoid Flex security error.

Hi there ! When doing a snapshot with flex bipmapdata.draw() a security error is raised if the image does not come from an allowed domain. I am trying to add images from several urls sources (google image) therefore i can't call draw(). If however the image is frow my server www.foo.com which has a nice crossdomain.xml its all good. ...

How do I use Microsoft AD and php single sign on web app?

I'm vaguely aware that on a computer joined to a domain IE can be asked to send some extra headers that I could use to automatically sign on to an application. I've got apache running on a windows server with mod php. I'd like to be able to avoid the user having to log in if necessary. I've found some links talking about kebros and apach...

Nginx Reverse Proxy to custom Mochiweb application

I have Nginx as my front-end web server listening on port 80. And certain requests, I've set up nginx to reverse proxy it to a mochiweb based web server that I've written, listening on Port 8000. My nginx configuration for this looks like this: location /mymochiserver { proxy_pass http://127.0.0.1:8000; ...

What experience do you have using nginx and memcached to optimize a web site?

We have a Java EE-based web application running on a Glassfish app server cluster. The incoming traffic will mainly be RESTful requests for XML-based representations of our application resources, but perhaps 5% of the traffic might be for JSON- or XHTML/CSS-based representations. We're now investigating load-balancing solutions to dist...

Nginx location directive doesn't seem to be working. Am I missing something?

I've set up Nginx as my main web server and have two Mochiweb based servers behind it. Certain requests are reverse-proxied to these two servers. now, I want to access phpmyadmin (located at /var/www/nginx-default/phpMyAdmin) using nginx, but it keeps saying Error 404 not found. Am I missing something obvious here? server { #######...

Nginx - Customizing 404 page

Nginx+PHP (on fastCGI) works great for me, but when I enter a path to a PHP file which doesnt exit, instead of getting the default 404 error page (which comes for any invalid .html file), I simply get a "No input file specified.". How can I customize this page? ...

How to generate url with sub domain to new url with query string?

Hi everyone, I'm very new with Nginx, and now I want to use Nginx to generate new url from the url user passed. Example: User type to browser like http://us.domain.com, and I want Nginx generates to http://www.domain.com/?portal=us or http://domain.com/?portal=us. How can I rewrite the nginx to do this? Best regards, Leakhina ...

How to set up Nginx as a caching reverse proxy?

I heard recently that Nginx has added caching to its reverse proxy feature. I looked around but couldn't find much info about it. I want to set up Nginx as a caching reverse proxy in front of Apache/Django: to have Nginx proxy requests for some (but not all) dynamic pages to Apache, then cache the generated pages and serve subsequent re...