Welcome! Log In Create A New Profile

Advanced

Re: Conversion of PHP single machine setup to nginx/php residing on different boxes

Johannes Graumann
June 06, 2012 04:12PM
Francis Daly wrote:

> On Wed, Jun 06, 2012 at 04:18:10PM +0300, Johannes Graumann wrote:
>
> Hi there,
>
>> > location ~ \.php$ {
>> > try_files $uri =404;
>
> try_files refers to local files only. http://nginx.org/r/try_files
>
> You probably don't want it here at all.
>
>> > fastcgi_pass 10.10.10.3:9000;
>> > fastcgi_index index.php;
>> > fastcgi_param SCRIPT_FILENAME
>> http://10.10.10.3:80/$fastcgi_script_name;
>
> SCRIPT_FILENAME is a parameter that the fastcgi server will read, and
> it will expect it to refer to a file on its filesystem that it should
> load and process.
>
> So: if the client requests the url /one/two.php, what file on the
> 10.10.10.3 server do you want that to correspond to? (From the perspective
> of the fasctcgi server, in case it is chroot'ed.)
>
> Make SCRIPT_FILENAME be that filename.

Thanks a lot for your pointers, which nudged me in the right direction.
After also finding http://nginxlibrary.com/resolving-no-input-file-
specified-error/ I came up with the following, which is working (a
"info.php" script at the documentroot containing a call to "phpinfo()" is
rendered properly and the output has "Server API: CGI/FastCGI"):

> server {
> listen 443;
> server_name XXX.org XXX;
> client_max_body_size 40M;
> # SSL is using CACert credentials
> ssl on;
> ssl_certificate /etc/ssl/private/cacert.XXX.org.pem;
> ssl_certificate_key
/etc/ssl/private/cacert.XXX.org_privatkey.pem;
> ssl_session_timeout 5m;
> ssl_protocols SSLv3 TLSv1;
> ssl_ciphers ALL:!ADH:!EXPORT56:!LOW:RC4+RSA:+HIGH:+MEDIUM:
+SSLv3:+EXP;
> ssl_prefer_server_ciphers on;
> # Proxy the "feng-container" lxc container
> root /var/www/;
> location / {
> proxy_pass http://10.10.10.3:80/;
> index index.php index.html index.htm;
> }
> location ~ \.php$ {
> fastcgi_pass 10.10.10.3:9000;
> fastcgi_index index.php;
> fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
> include fastcgi_params;
> }
> }

Thank you. Joh


_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Conversion of PHP single machine setup to nginx/php residing on different boxes

Johannes Graumann June 06, 2012 09:18AM

Re: Conversion of PHP single machine setup to nginx/php residing on different boxes

Francis Daly June 06, 2012 09:36AM

Re: Conversion of PHP single machine setup to nginx/php residing on different boxes

Johannes Graumann June 06, 2012 04:12PM

Re: Conversion of PHP single machine setup to nginx/php residing on different boxes

Johannes Graumann June 24, 2012 06:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 187
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