Welcome! Log In Create A New Profile

Advanced

Re: Need help with converting from Apache.

Ian Hobson
April 20, 2009 05:54AM
Bump. Anybody.

How can I let php execute /parser/parser.php and stop nginx serving
anything else in /parser and sub-directories, except
/parser/gif/* which should be permitted?

Thanks

Ian

Ian Hobson wrote:
> Hi All,
>
> I have a site that uses phpcms - and the nginx setup for it is below -
> and it works.
>
> server {
> listen 80;
> #
> server_name domain.com www.domain.com ;
> root /var/www/domain.com/htdocs;
> index index.php index.html index.htm;
> access_log /var/www/domain.com/access.log;
>
> #
> # redirect server error pages to the static page /50x.html
> #
> error_page 500 502 503 504 /50x.html;
>
> # send (*.htm) to /parser/parser.php?file=%1
> location ~* \.htm$ {
> rewrite ^(.*\.htm)$ /parser/parser.php?file=$1;
> }
> # all .php requests to fastcgi
> location ~ \.php$ {
> include /etc/nginx/fastcgi_params;
> fastcgi_pass 127.0.0.1:9000;
> }
> # request password for stats
> location ^~ /usage/ {
> auth_basic "Hello, please login";
> auth_basic_user_file /var/www/domain.com/passwords;
> }
> }
>
> When apache was serving the site, the /parser directory had a
> .htaccess file in it that stopped any files being served, but it did
> not stop the requests
> for /parser/parser.php?params being actioned via the rewrite.
>
> How can I add the same here?
>
> Thanks
>
> Ian
>
> p.s nginx version 0.6.35
>
>
>
>
Subject Author Posted

Need help with converting from Apache.

Ian Hobson April 18, 2009 03:31PM

Re: Need help with converting from Apache.

Ian Hobson April 20, 2009 05:54AM

Re: Need help with converting from Apache.

SSSlippy April 20, 2009 04:41PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 265
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready