Forum: NGINX config questions

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Chris Cortese (Guest)
on 2009-03-01 12:48
(Received via mailing list)
ok so I still have a couple issues.

1.  Something about my latest config has now broken my javascript loader
again.
2.  I need to be able to post to, for example,
/myController/myFormHandler and have it send the $_POST, so just using
error 404 to redirect to /index.php?q=$1 is not sufficient.

It seems that if I fix one thing it breaks something else.  Here's what
I've got now:

server {
  listen   81;
  server_name  dev.mysite.com;

  access_log  /var/log/nginx/dev_mysite.access.log;
  error_log /var/log/nginx/dev_mysite.error.log;

  root /home/my_linux_user/www/dev/mysite/trunk/html/public;

  location / {
    rewrite ^(.*)$ /index.php?q=$1;
    index index.php;
    error_page 404 /index.php?q=$1;
  }

  location /style/ {
    rewrite ^/style/(.*)$ /combine.php?type=css&files=$1 last;
  }

  location /javascript/ {
    rewrite ^/javascript/(.*)$ /combine.php?type=javascript&files=$1
last;
  }

  location /tmp/ {
  }

  location /filestore/ {
  }

  location /images/ {
  }

  location /cgi-bin/ {
    root /home/my_linux_user/www/dev/mysite/trunk;
    fastcgi_pass unix:/tmp/cgi.sock;
    include /etc/nginx/perl_fcgiwrap_params;
  }

  location ~* (jpg|jpeg|gif|png|js|css) {
      expires    30d;
      access_log off;
  }

  location ~ \.php$ {
    fastcgi_pass  127.0.0.1:10005;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME
/home/my_linux_user/www/dev/mysite/trunk/html/public$fastcgi_script_name;
#    fastcgi_param SCRIPT_FILENAME
/home/my_linux_user/www/dev/mysite/trunk/html/public/index.php;
    include /etc/nginx/fastcgi_params;
  }

  location = /style/main_style.php {
    fastcgi_pass  127.0.0.1:10005;
    fastcgi_param SCRIPT_FILENAME
/home/my_linux_user/www/dev/mysite/trunk/html/public/style/main_style.php;
    include /etc/nginx/fastcgi_params;
  }
}
This topic is locked and can not be replied to.