nginx

Where can I find application runtime errors using Nginx, Starman, Plack and Catalyst?

I have managed successfully to server my Catalyst app on my development machine using Plack + Starman, using a daemon script I based on one I found in Dave Rolsky's Silki distribution. I then set up nginx to reverse proxy to my Starman server, and aliased the static directory for nginx to serve. So far, so good. However, I am at a loss ...

nginx and codeigniter (telling a server to put all traffic through index.php?)

Basically, the htaccess I use with apache says something like "if the requested file or directory does not exist, route the request through index.php" How exactly can I do this with nginx? That way, if a stylesheet is requested, it's served. But if the url isn't to a file on disk, then it should run the framework. ...

Rails sends 0 byte files using send_file

I can't get send_file(Model.attachment.path) to work. It doesn't fail, instead, it sends a 0 byte size file to the client, the file names are correct though. This problem started happening after I did a big migration from Rails 2.3.8 to 3. There were a lot of other things that took place in this migration and I will try my best to deta...

CakePHP 1.3.3 and Nginx + FastCGI

I've used the following Nginx CakePHP Vhost template for a while now, with success. http://codepaste.appspot.com/show?id=270121 But now it seems that the newer version of CakePHP (1.3.3) doesn't work at all. It might be that it has nothing to do with the above Vhost template and that it is an error with FastCGI or Nginx. The error i...

Ruby on Rails: How would I handle 10 concurrent users? Do I need more CPU?

Sorry if this might seem obvious. I've monitored that a web request on my Rails app uses 30-33% of CPU every time. For example, if I load a web page, then 30% of CPU is used. Does that mean that my box can only handle 3 concurrent web requests, and will stall if there are more than 3 web requests (i.e. I'll get a 100% CPU)? If so, does ...

max age with nginx/passenger/memcached/rails2.3.5

I notice that in my production enviornment (where I have memcached implemented) in see a cache-control - max-age header in firebug, anytime I am looking at an index page (posts for example). Cache-Control max-age=315360000 In my dev environment that header looks like following. Cache-Contro private, max-age=0, must-revalidate As...

Does the nginx "upstream" directive have a port setting?

I use upstream and proxy for load balancing. The directive proxy_pass http://upstream_name uses the default port, which is 80. However, if the upstream server does not listen on this port, then the request fails. How do I specify an alternate port? my configuration: http{ #... upstream myups{ server 192.168.1.100:6666; server 192.1...

How to point a domain name to a web server inside of VMWare Player?

What I'm trying to do is point a spare domain I have lying around to a Nginx install on Ubuntu in a VMWare Player image. My Nginx server configuration simply looks like: server { listen 80; server_name ----.com *.----.com; root root/sites/test/public; passenger_enabled on; } The ---- of course being my domain....

Running Multiple Sites with Django's Sites Framework through Gunicorn/Nginx

I have a Django based CMS that uses Django's sites framework and Nginx/Apache/mod_wsgi virtual hosts to run a number of websites on different domains. We're assessing other options for a Django stack and have the CMS running with a single site on a new server with Nginx proxying to Gunicorn (gunicorn_django, specifically). Although this...

nginx + php-fpm ignores no-cache headers

I'm using the following header on a php page. // Prevent page caching. header('Expires: Tue, 20 Oct 1981 05:00:00 GMT'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', FALSE); header('Pragma: no-cache'); I'm also using a rand=999999999 (with a real random number...

Non-blocking IO with Ruby?

I have some questions about non-blocking IO: If I use Ruby without EventMachine on Nginx, could I leverage non-blocking IO? If i use Ruby with EventMachine but on Apache, could I leverage non-blocking IO? If the above answers are no, then it means I have to use Ruby with EventMachine on Nginx to leverage non-blocking IO? ...

How to enable timeout per each restful web service method

How would one go about setting timeouts for each REST API method on the server side. For example I have certain web service methods that upload images and I want to increase the timeouts for these methods compared to ones that have lower http payloads. Architecture I am dealing with: haproxy, nginx, tomcat ...

[nginx] Forcing user's browser to save files to cache

My website is a online music portal with online playing system. When user play a song, it is served by nginx server on port 8080 on my server. The problem is when the song has finished playing, the player repeats the song. But every time it replays, it makes another call to server and starts downloading the file again to play. Previ...

Django and Python + uWSGI

Using instruction I try to connect Python + uWSGI. I made default project in a folder /home/sanya/django/pasteurl. However, have opened it in a browser I get uWSGI Error wsgi application not found Logs contain the following: binding on TCP port: 9001 your server socket listen backlog is limited to 64 connections added /home/sanya/dj...

Help Converting Apache htaccess to Nginx Rewrite rules

I need to convertthe following Apache htaccess rules to Nginx Rewrite rules: Redirect 301 /feed.php http://www.example.com/feed/ Thanks very much~ ...

Sleep will stop Nginx since it's an event-based server?

I think if you have setTimeout=1 then the node server will be unavailable for all requests in 1 second since it's event-based, non-threaded web server (correct me if I'm wrong). I've heard that Nginx is also an event-based web server. Doesn't that mean that if I have sleep 1 then it would be halted for all requests in 1 second? ...

How do I configure nginx and CodeIgniter?

I'm running nginx on my home computer for development. I also have it linked to DynDNS so I can show progress to my co-worker a bit easier. I can't seem to get nginx to rewrite to CodeIgniter properly. I have CodeIgniters uri_protocol set to REQUEST_URI. All pages that should be showing up wtih content show up completely blank. If I ph...

django on nginx & apache : where to handle 404 & 500 error ?

I know there is 404 error handling in django. But is it better to just put that config in nginx ? This ST thread has the solution for putting it. - http://stackoverflow.com/questions/1024199/nginx-customizing-404-page Is that how everyone handles it when using nginx ? I have created my own 404.html & 500.html in the sites theme, want ...

How can I run something in a thread with passenger?

Hello, I'm using Phusion Passenger with my nginx to deploy rails/sinatra applications, and I'm currently having a problem. I want to run a class that checks for new submissions to reddit.com every 30 seconds. But since passenger shuts down the application after x seconds of idle time, it won't keep checking. Yes, I've tried to set pass...

Nginx upload progress with Rails

I am having some trouble getting an upload progress working for my file upload. new.html.erb <%= form_for @image, (onsubmit="openProgressBar(); return true;"), :html => { :multipart => true } do |f| %> <%= f.file_field :photo %> </p> div> <div class="actions"> <%= f.submit %> </div> <br /> <iframe id="u...