Newbie config not working..

merlin corey merlincorey at dc949.org
Fri Dec 18 01:18:09 MSK 2009


On Thu, Dec 17, 2009 at 11:58 AM, mystique <nginx-forum at nginx.us> wrote:
> hey all, nginx from freebsd ports 0.7.64 i386
>
> Below is my config.
>
> I am trying to move from a lighttpd server and try out nginx.  Below is my actual config.  Everything is installed from ports.  and php is being run by spawn-fcgi
>
> nginx.conf:
>
>     1  worker_processes  2;
>     2
>     3  events {
>     4      worker_connections  1024;
>     5      use kqueue;
>     6  }
>     7
>     8  http {
>     9      include       mime.types;
>    10      default_type  application/octet-stream;
>    11      sendfile        on;
>    12      keepalive_timeout  65;
>    13
>    14      access_log  /var/log/nginx-access.log;
>    15      error_log   /var/log/nginx-error.log;
>    16
>    17      tcp_nopush  on;
>    18      tcp_nodelay on;
>    19      charset     utf-8;
>    20      gzip        on;
>    21      gzip_types  text/plain application/xml text/javascript;
>    22      gzip_min_length     512;
>    23
>    24  server {
>    25          listen          80;
>    26          server_name     _;
>    27          server_name_in_redirect off;
>    28          access_log /var/log/nginx-default.log;
>    29
>    30          location / {
>    31          index index.html;
>    32          root    /usr/local/www/nginx;
>    33          }
>    34
>    35      }
>    36
>    37
>    38  server {
>    39          listen          80;
>    40          server_name     domain.org www.domain.org;
>    41          root            /usr/local/www/wordpress;
>    42          include         php_fastcgi_support;
>    43          index           index.php;
>    44
>    45          location / {
>    46                  try_files $uri $uri/ /index.php?q=$uri&$args;
>    47          }
>    48
>    49      }
>    50
>    51  server {
>    52          listen          443;
>    53          ssl             on;
>    54          ssl_certificate         /usr/local/www/ssl/server.crt;
>    55          ssl_certificate_key     /usr/local/www/ssl/server.key;
>    56
>    57          server_name     secure.domain.org;
>    58
>    59          keepalive_timeout 65;
>    60
>    61          location / {
>    62                  root /usr/local/www/data;
>    63                  index index.htm;
>    64          }
>    65
>    66          location /wiki/ {
>    67                  alias /usr/local/www/dokuwiki/;
>    68                  include         php_fastcgi_support;
>    69                  index           doku.php;
>    70          }
>    71
>    72          if (!-f $request_filename) {
>    73                  rewrite ^(/wiki/)(.*)?(.*)  $1doku.php?id=$2&$3 last;
>    74                  rewrite ^(/wiki/)$ $1doku.php last;
>    75          }
>    76
>    77  }
>    78
>    79  }
>
>
>
> php_fastcgi_support:
>
>     1          location ~ \.php$ {
>     2                  fastcgi_pass   127.0.0.1:9000;
>     3                  fastcgi_index  index.php;
>     4                  fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
>     5                  include        fastcgi_params;
>     6          }
>
>
> going to http://www.domain.org/ shows the wordpress site like it should and wp-admin and the likes all seem to work (wonderful)
>
> The part that is not working as desired is the ssl portion.
>
> going to https://secure.domain.org works as intended; which is rendering the contents of /usr/local/www/data trying to get to https://secure.domain.org/wiki/(index.php) does not work at all.
>
> I get the generic "no input file specified".
>
> 192.168.10.199 - - [17/Dec/2009:14:39:28 -0500] "GET /wiki/index.php HTTP/1.1" 404 62 "-"
> 192.168.10.199 - - [17/Dec/2009:14:40:40 -0500] "GET /wiki/doku.php  HTTP/1.1" 404 62 "-"
>
> Can someone suggest what I might be doing wrong?
>
> thanks in advance
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,31388,31388#msg-31388
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>

Helped on IRC; the problem was that the PHP location had a different
root from the wiki location, so we added another PHP location specific
to the wiki.  A bit later I will be posting updated pretty-urls setup
to the wiki.

-- Merlin



More information about the nginx mailing list