Login to download the latest version of Mint and your favorite Pepper, purchase additional licenses, or post in the Forum. Don't have an account? Create one!

In Partnership with Media Temple

Mint Forum

Configuring Mint for nginx and Ruby on Rails

This is a nginx configuration that includes a mongrel cluster and php running as fcgi on port 1026. Mint is in approot/public/mint/ .

Edit it to fit your needs. Works for me :)

upstream filipcic {
    server 127.0.0.1:8000;
}

server {
    listen       192.168.1.2;

    server_name     filipcic.com www.filipcic.com;

    access_log      /var/log/nginx/filipcic.access_log main;
    error_log       /var/log/nginx/filipcic.error_log;

    root /var/www/filipcic.com/current/public;
    index  index.html index.htm index.php;

    # this rewrites all the requests to the maintenance.html
    # page if it exists in the doc root. This is for capistrano's
    # disable web task
    if (-f $document_root/system/maintenance.html) {
            rewrite  ^(.*)$  /system/maintenance.html last;
            break;
    }

    location /mint/ {
    }

    location ~ ^/mint/.*\.php {
            index index.php;
            include /etc/nginx/fastcgi_params;
            fastcgi_pass  127.0.0.1:1026;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME /var/www/filipcic.com/current/public$fastcgi_script_name;
    }

    location / {
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_redirect false;

            # if this request matches a static file just send it out.
                    if (-f $request_filename) {
                    break;
                    } 

            if (-f $request_filename/index.html) {
                    rewrite (.*) $1/index.html break;
            }

            if (-f $request_filename.html) {
                    rewrite (.*) $1.html break;
            }

            if (!-f $request_filename) {
                    proxy_pass http://filipcic;
                    break;
                    }
            }

            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
            root   html;
    }
}

Also have a look at my Mint Ruby on Rails plugin http://haveamint.com/forum/after_dinner … ils_plugin

I’m doing something similar, but I had my PHP section at the bottom of the Nginx config which forced me to do some odd rewrite rules in the Rails section.

I’ll try out the technique you list here.

You must be logged in to reply. Login above or create an account

Hey there, I have officially suspended sales and support of Mint. The Create Account, Add License, Transfer License, and Contact forms have been disabled. Existing customers may continue to login and download Mint.

More info Continue