• Nginx and php,pl,cgi in users subdirectory

    From The Doctor@21:1/5 to All on Wed Aug 19 21:52:50 2020
    XPost: comp.lang.php

    How does one configure php, pl or cgi files is user subdirectories
    on nginx ?
    --
    Member - Liberal International This is doctor@@nl2k.ab.ca Ici doctor@@nl2k.ab.ca
    Yahweh, Queen & country!Never Satan President Republic!Beware AntiChrist rising!
    Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b New Brunswick Save The PRovince Vote Liberal 14 Sept!!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jerry Stuckle@21:1/5 to The Doctor on Wed Aug 19 21:16:16 2020
    XPost: comp.lang.php

    On 8/19/2020 5:52 PM, The Doctor wrote:
    How does one configure php, pl or cgi files is user subdirectories
    on nginx ?


    Configuring PHP for a particular web server or OS is part of that installation's configuration, not PHP itself. I suggest you look at
    nginx documentation and/or for a group of forum related to nginx (or, in
    the case of Linux, your distro may have information. You'll get much
    better answers.,

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    jstucklex@attglobal.net
    ==================

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to jstucklex@attglobal.net on Thu Aug 20 02:22:10 2020
    XPost: comp.lang.php

    In article <rhkisp$p6s$1@jstuckle.eternal-september.org>,
    Jerry Stuckle <jstucklex@attglobal.net> wrote:
    On 8/19/2020 5:52 PM, The Doctor wrote:
    How does one configure php, pl or cgi files is user subdirectories
    on nginx ?


    Configuring PHP for a particular web server or OS is part of that >installation's configuration, not PHP itself. I suggest you look at
    nginx documentation and/or for a group of forum related to nginx (or, in
    the case of Linux, your distro may have information. You'll get much
    better answers.,


    Tried sending an e-mail to the nginx list only that a bnch on
    SPF et al
    has screwed things up.

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    jstucklex@attglobal.net
    ==================


    --
    Member - Liberal International This is doctor@@nl2k.ab.ca Ici doctor@@nl2k.ab.ca
    Yahweh, Queen & country!Never Satan President Republic!Beware AntiChrist rising!
    Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b New Brunswick Save The PRovince Vote Liberal 14 Sept!!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arno Welzel@21:1/5 to All on Thu Aug 20 09:46:36 2020
    XPost: comp.lang.php

    The Doctor:

    How does one configure php, pl or cgi files is user subdirectories
    on nginx ?

    <https://www.google.com/search?q=nginx+php>


    --
    Arno Welzel
    https://arnowelzel.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to usenet@arnowelzel.de on Thu Aug 20 12:57:15 2020
    XPost: comp.lang.php

    In article <hq6o2tF47j0U1@mid.individual.net>,
    Arno Welzel <usenet@arnowelzel.de> wrote:
    The Doctor:

    How does one configure php, pl or cgi files is user subdirectories
    on nginx ?

    <https://www.google.com/search?q=nginx+php>


    Tried that as well.


    --
    Arno Welzel
    https://arnowelzel.de


    --
    Member - Liberal International This is doctor@@nl2k.ab.ca Ici doctor@@nl2k.ab.ca
    Yahweh, Queen & country!Never Satan President Republic!Beware AntiChrist rising!
    Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b New Brunswick Save The PRovince Vote Liberal 14 Sept!!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J.O. Aho@21:1/5 to The Doctor on Thu Aug 20 17:16:31 2020
    XPost: comp.lang.php

    On 20/08/2020 14.57, The Doctor wrote:
    In article <hq6o2tF47j0U1@mid.individual.net>,
    Arno Welzel <usenet@arnowelzel.de> wrote:
    The Doctor:

    How does one configure php, pl or cgi files is user subdirectories
    on nginx ?

    <https://www.google.com/search?q=nginx+php>


    Tried that as well.

    There is no different of configuring userdir from configuring a normal location. You will need to configure for each file extension.

    --

    //Aho

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to J.O. Aho on Thu Aug 20 22:16:34 2020
    XPost: comp.lang.php

    In article <hq7iefF9kf9U1@mid.individual.net>,
    J.O. Aho <user@example.net> wrote:
    On 20/08/2020 14.57, The Doctor wrote:
    In article <hq6o2tF47j0U1@mid.individual.net>,
    Arno Welzel <usenet@arnowelzel.de> wrote:
    The Doctor:

    How does one configure php, pl or cgi files is user subdirectories
    on nginx ?

    <https://www.google.com/search?q=nginx+php>


    Tried that as well.

    There is no different of configuring userdir from configuring a normal >location. You will need to configure for each file extension.


    did that. here is the error I am getting:

    Logs:

    2020/08/16 20:05:09 [error] 1971#100506: *623 FastCGI sent in stderr: "Unable to
    +open primary script: /usr/home//html/~doctor/blog/serendipity/comment.php (No +such file or directory)" while reading response header from upstream, client: +46.229.168.152, server: www.nk.ca, request: "GET +/~doctor/blog/serendipity/comment.php HTTP/1.1", upstream: +"fastcgi://unix:/var/run/php-fpm.sock:", host: "www.nk.ca"
    2020/08/16 20:16:20 [error] 2707#100146: *1259 FastCGI sent in stderr: "Unable +to open primary script: /usr/home//html/~doctor/blog/serendipity/index.php (No +such file or directory)" while reading response header from upstream, client: +116.202.106.130, server: www.nk.ca, request: "GET +/~doctor/blog/serendipity/index.php?%2Ffeeds%2Findex_rss2= HTTP/1.1", upstream:
    +"fastcgi://unix:/var/run/php-fpm.sock:", host: "www.nk.ca"
    2020/08/16 20:22:22 [error] 2707#100146: *2014 open() +"/usr/home/doctor/html/blog/serendipity/feeds/index.rss2" failed (2: No such +file or directory), client: 51.254.168.38, server: www.nk.ca, request: "GET +/~doctor/blog/serendipity/feeds/index.rss2 HTTP/1.0", host: "www.nk.ca" 2020/08/16 20:22:23 [error] 2707#100146: *2028 open() +"/usr/home/doctor/html/blog/serendipity/feeds/index.rss2" failed (2: No such +file or directory), client: 51.254.168.38, server: www.nk.ca, request: "GET +/~doctor/blog/serendipity/feeds/index.rss2 HTTP/1.1", host: "www.nk.ca", +referrer: "http://www.nk.ca/~doctor/blog/serendipity/feeds/index.rss2"

    And here is the configuration in question

    location ~ ^/~(.+?)(/.*)?$ {
    alias /usr/home/$1/html/$2;
    index index.php index.phtml index.shtml index.html index.htm;
    autoindex on;


    location ~ .*~.*\.php$ {
    #root html;
    #try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;

    # Mitigate https://httpoxy.org/ vulnerabilities
    #fastcgi_param HTTP_PROXY "";
    fastcgi_pass unix:/var/run/php-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /usr/home/$1/html$fastcgi_script_name;
    include /usr/local/etc/nginx/fastcgi_params;
    }

    }

    Why am I not getting /usr/home/html/~doctor instead of /usr/home/doctor/html ?

    --

    //Aho


    --
    Member - Liberal International This is doctor@@nl2k.ab.ca Ici doctor@@nl2k.ab.ca
    Yahweh, Queen & country!Never Satan President Republic!Beware AntiChrist rising!
    Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b New Brunswick Save The PRovince Vote Liberal 14 Sept!!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lew Pitcher@21:1/5 to The Doctor on Thu Aug 20 19:24:50 2020
    XPost: comp.lang.php

    On August 20, 2020 18:16, The Doctor wrote:

    In article <hq7iefF9kf9U1@mid.individual.net>,
    J.O. Aho <user@example.net> wrote:
    On 20/08/2020 14.57, The Doctor wrote:
    In article <hq6o2tF47j0U1@mid.individual.net>,
    Arno Welzel <usenet@arnowelzel.de> wrote:
    The Doctor:

    How does one configure php, pl or cgi files is user subdirectories
    on nginx ?

    <https://www.google.com/search?q=nginx+php>


    Tried that as well.

    There is no different of configuring userdir from configuring a normal >>location. You will need to configure for each file extension.


    did that. here is the error I am getting:

    Logs:

    2020/08/16 20:05:09 [error] 1971#100506: *623 FastCGI sent in stderr:
    "Unable to +open primary script: /usr/home//html/~doctor/blog/serendipity/comment.php (No +such file or directory)" while reading response header from upstream, client: +46.229.168.152, server: www.nk.ca, request: "GET +/~doctor/blog/serendipity/comment.php HTTP/1.1", upstream: +"fastcgi://unix:/var/run/php-fpm.sock:", host: "www.nk.ca" 2020/08/16 20:16:20 [error] 2707#100146: *1259 FastCGI sent in stderr: "Unable +to
    open primary script: /usr/home//html/~doctor/blog/serendipity/index.php
    (No +such file or directory)" while reading response header from upstream, client: +116.202.106.130, server: www.nk.ca, request: "GET +/~doctor/blog/serendipity/index.php?%2Ffeeds%2Findex_rss2= HTTP/1.1", upstream: +"fastcgi://unix:/var/run/php-fpm.sock:", host: "www.nk.ca" 2020/08/16 20:22:22 [error] 2707#100146: *2014 open() +"/usr/home/doctor/html/blog/serendipity/feeds/index.rss2" failed (2: No
    such +file or directory), client: 51.254.168.38, server: www.nk.ca,
    request: "GET +/~doctor/blog/serendipity/feeds/index.rss2 HTTP/1.0", host: "www.nk.ca" 2020/08/16 20:22:23 [error] 2707#100146: *2028 open() +"/usr/home/doctor/html/blog/serendipity/feeds/index.rss2" failed (2: No
    such +file or directory), client: 51.254.168.38, server: www.nk.ca,
    request: "GET +/~doctor/blog/serendipity/feeds/index.rss2 HTTP/1.1", host: "www.nk.ca", +referrer: "http://www.nk.ca/~doctor/blog/serendipity/feeds/index.rss2"

    And here is the configuration in question

    location ~ ^/~(.+?)(/.*)?$ {
    alias /usr/home/$1/html/$2;
    index index.php index.phtml index.shtml index.html index.htm;
    autoindex on;

    I don't use nginx, and I /know/ that many websites recommend the above configuration change to enable "user" directories, but the "location" regexp looks wrong to me.

    Consider the part that reads:
    ^/~(.+?)(/.*)?$
    This is meant to break the "path" part of the given URL into two components: the users name, and the path component relative to the user's web directory. Parsing starts at the first slash of the URL path component, ^/
    requires a tilde ~
    takes the characters up to the first slash as $1 (.+?)
    takes any remaining characters as $2 (/.*)?
    and plugs them into the alias

    Now, to me, the problem is the regex component for the $1 assignment.
    The brackets are regex metasymbols that group characters together; they are there to indicate that the regex within the brackets will be taken as one,
    and (in this case) substituted for $1. We can, for now, ignore the brackets, leaving
    .+?
    The
    .+
    says that we require one or more (+) characters of any value (.), so
    .+
    matches a name.
    But, what does the
    ?
    signify.
    It, too, is a metacharacter, and matches a count of zero or one of the preceding character. But, there is no "preceding character" that it can
    apply to. It looks /odd/ to me.

    So, my suggestion is that the common instructions are incorrect, in that
    the regex for $1 is malformed and won't work as expected.

    You could try a slightly different regex:
    ^/~(.+)(/.*)?$
    as in
    location ~ ^/~(.+)(/.*)?$ {
    alias /usr/home/$1/html/$2;

    I don't guarantee this to work, but it makes more sense to me, and if it
    fails then you are no further in trouble than you already are.



    location ~ .*~.*\.php$ {
    #root html;
    #try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;

    # Mitigate https://httpoxy.org/ vulnerabilities
    #fastcgi_param HTTP_PROXY "";
    fastcgi_pass unix:/var/run/php-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME
    /usr/home/$1/html$fastcgi_script_name;
    include /usr/local/etc/nginx/fastcgi_params;
    }

    }

    Why am I not getting /usr/home/html/~doctor instead of
    /usr/home/doctor/html ?

    HTH
    --
    Lew Pitcher
    "In Skills, We Trust"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eli the Bearded@21:1/5 to lew.pitcher@digitalfreehold.ca on Fri Aug 21 00:14:36 2020
    In comp.infosystems.www.servers.unix,
    Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
    Consider the part that reads:
    ^/~(.+?)(/.*)?$
    This is meant to break the "path" part of the given URL into two components:
    ...
    The
    .+
    says that we require one or more (+) characters of any value (.), so
    .+
    matches a name.
    But, what does the
    ?
    signify.

    In PCRE the syntax "+?" indicates the MINIMAL (non-greedy) number of the proceeding item to satisfy context, as opposed to plain "+" being the
    MAXIMAL (greedy) match. In the case of

    ^/~(.+?)(/.*)?$

    It effectively means the first period will never match "/". In some
    contexts, using non-greedy matches can have surprising results. In
    particular if any of the context is multiple literal characters, when
    an exact literal might not be true.[*] I try to avoid non-greedy when
    possible, eg:

    ^/~([^/]+)(/.*)?$

    But non-greedy is safe and not wrong (here), so it can be used.

    It, too, is a metacharacter, and matches a count of zero or one of the preceding character. But, there is no "preceding character" that it can
    apply to. It looks /odd/ to me.

    So, my suggestion is that the common instructions are incorrect, in that
    the regex for $1 is malformed and won't work as expected.

    You could try a slightly different regex:
    ^/~(.+)(/.*)?$

    That will break when there are subdirectories, becuase the first + is
    greedy.
    Input: /~lew/have/I/got/an/example/for/you
    Output: $1 = /~lew/have/I/got/an/example/for
    $2 = /you


    [*] One of the classic examples comes from naive parsing of HTML.
    <a.*?href="(.*?)">

    Works fine on input <a href="https://qaz.wtf/">
    -> $1 = https://qaz.wtf/

    Works fine on input <a class="link" href="https://qaz.wtf/">
    -> $1 = https://qaz.wtf/

    Works poorly on input <a href="https://qaz.wtf/" class="link">
    -> $1 = https://qaz.wtf/" class="link

    Works TERRIBLY on input
    <a href="foob.html" class='link'>Ten paragraphs</a> of html
    follow all without any <A> tags. And then
    <a href="https://qaz.wtf/" class="link">
    -> $1 = foob.html" class='link'>Ten paragraphs</a> of html
    follow all without any <A> tags. And then
    <a href="https://qaz.wtf/" class="link

    Elijah
    ------
    never uses user directories any more and hasn't looked at the problem here

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to *@eli.users.panix.com on Fri Aug 21 02:59:39 2020
    In article <eli$2008201952@qaz.wtf>,
    Eli the Bearded <*@eli.users.panix.com> wrote:
    In comp.infosystems.www.servers.unix,
    Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
    Consider the part that reads:
    ^/~(.+?)(/.*)?$
    This is meant to break the "path" part of the given URL into two components: >...
    The
    .+
    says that we require one or more (+) characters of any value (.), so
    .+
    matches a name.
    But, what does the
    ?
    signify.

    In PCRE the syntax "+?" indicates the MINIMAL (non-greedy) number of the >proceeding item to satisfy context, as opposed to plain "+" being the
    MAXIMAL (greedy) match. In the case of

    ^/~(.+?)(/.*)?$

    It effectively means the first period will never match "/". In some
    contexts, using non-greedy matches can have surprising results. In
    particular if any of the context is multiple literal characters, when
    an exact literal might not be true.[*] I try to avoid non-greedy when >possible, eg:

    ^/~([^/]+)(/.*)?$

    But non-greedy is safe and not wrong (here), so it can be used.

    It, too, is a metacharacter, and matches a count of zero or one of the
    preceding character. But, there is no "preceding character" that it can
    apply to. It looks /odd/ to me.

    So, my suggestion is that the common instructions are incorrect, in that
    the regex for $1 is malformed and won't work as expected.

    You could try a slightly different regex:
    ^/~(.+)(/.*)?$

    That will break when there are subdirectories, becuase the first + is
    greedy.
    Input: /~lew/have/I/got/an/example/for/you
    Output: $1 = /~lew/have/I/got/an/example/for
    $2 = /you


    [*] One of the classic examples comes from naive parsing of HTML.
    <a.*?href="(.*?)">

    Works fine on input <a href="https://qaz.wtf/">
    -> $1 = https://qaz.wtf/

    Works fine on input <a class="link" href="https://qaz.wtf/">
    -> $1 = https://qaz.wtf/

    Works poorly on input <a href="https://qaz.wtf/" class="link">
    -> $1 = https://qaz.wtf/" class="link

    Works TERRIBLY on input
    <a href="foob.html" class='link'>Ten paragraphs</a> of html
    follow all without any <A> tags. And then
    <a href="https://qaz.wtf/" class="link">
    -> $1 = foob.html" class='link'>Ten paragraphs</a> of html
    follow all without any <A> tags. And then
    <a href="https://qaz.wtf/" class="link

    Elijah
    ------
    never uses user directories any more and hasn't looked at the problem here

    Just because you find this in a search engine does not make it correct.

    Same result/ https://domain.name/~user/ works

    but not the subdirectories.
    --
    Member - Liberal International This is doctor@@nl2k.ab.ca Ici doctor@@nl2k.ab.ca
    Yahweh, Queen & country!Never Satan President Republic!Beware AntiChrist rising!
    Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b New Brunswick Save The PRovince Vote Liberal 14 Sept!!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J.O. Aho@21:1/5 to The Doctor on Fri Aug 21 10:47:56 2020
    XPost: comp.lang.php

    On 21/08/2020 00.16, The Doctor wrote:
    In article <hq7iefF9kf9U1@mid.individual.net>,
    J.O. Aho <user@example.net> wrote:
    On 20/08/2020 14.57, The Doctor wrote:
    In article <hq6o2tF47j0U1@mid.individual.net>,
    Arno Welzel <usenet@arnowelzel.de> wrote:
    The Doctor:

    We are quite off topic for c.l.p, so that why an OT in the subject.


    How does one configure php, pl or cgi files is user subdirectories
    on nginx ?

    <https://www.google.com/search?q=nginx+php>


    Tried that as well.

    There is no different of configuring userdir from configuring a normal
    location. You will need to configure for each file extension.


    did that. here is the error I am getting:
    location ~ ^/~(.+?)(/.*)?$
    Logs:

    2020/08/16 20:05:09 [error] 1971#100506: *623 FastCGI sent in stderr: "Unable to
    +open primary script: /usr/home//html/~doctor/blog/serendipity/comment.php (No
    +such file or directory)" while reading response header from upstream, client:
    +46.229.168.152, server: www.nk.ca, request: "GET

    Your regexp is incorrect, as Lew pointed out, but sadly his regexp will
    have same kind of issue and even if it had been working, there had been
    problem with potentially access directories that are not to ment to be
    served.

    The regexp you are looking for is: ^/~([\w-]*)(/.*)?$

    Next time you have issues with regexp in nginx, take a look at https://www.regextester.com/94055 and use the substitution section to
    see what values you really get.


    alias /usr/home/$1/html/$2;
    Why am I not getting /usr/home/html/~doctor instead of /usr/home/doctor/html ?

    I don't think you should have the tilde in the directory name, if you
    want to change the order, then you have to change the order in your
    alias, $1 is the username, the $2 is the path, so if you have
    /user/home/html directory filled with users web directories, tne you
    should have /usr/home/html/$1/$2. If you need to keep the tilde in the username, then you have to move the tilde in the regexp so it's inside
    the parentheses, but I recommend against that.


    location ~ .*~.*\.php$ {
    #root html;
    #try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;

    # Mitigate https://httpoxy.org/ vulnerabilities
    #fastcgi_param HTTP_PROXY "";
    fastcgi_pass unix:/var/run/php-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /usr/home/$1/html$fastcgi_script_name;
    include /usr/local/etc/nginx/fastcgi_params;
    }

    This looks really messy and another potential error source.

    location ~ \.php$ {
    try_files $uri =404;
    include fastcgi_params;
    fastcgi_pass unix:/var/run/php-fpm.sock;
    fastcgi_index index.php;
    }

    that should be neater and less prone to fail.


    PS. When you reply, remove the footer(s) if your news client don't
    manage to remove footers by itself.

    --

    //Aho

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to J.O. Aho on Fri Aug 21 13:21:58 2020
    XPost: comp.lang.php

    In article <hq9g1sFlpgpU1@mid.individual.net>,
    J.O. Aho <user@example.net> wrote:
    On 21/08/2020 00.16, The Doctor wrote:
    In article <hq7iefF9kf9U1@mid.individual.net>,
    J.O. Aho <user@example.net> wrote:
    On 20/08/2020 14.57, The Doctor wrote:
    In article <hq6o2tF47j0U1@mid.individual.net>,
    Arno Welzel <usenet@arnowelzel.de> wrote:
    The Doctor:

    We are quite off topic for c.l.p, so that why an OT in the subject.


    How does one configure php, pl or cgi files is user subdirectories >>>>>> on nginx ?

    <https://www.google.com/search?q=nginx+php>


    Tried that as well.

    There is no different of configuring userdir from configuring a normal
    location. You will need to configure for each file extension.


    did that. here is the error I am getting:
    location ~ ^/~(.+?)(/.*)?$
    Logs:

    2020/08/16 20:05:09 [error] 1971#100506: *623 FastCGI sent in stderr: >"Unable to
    +open primary script: /usr/home//html/~doctor/blog/serendipity/comment.php (No
    +such file or directory)" while reading response header from upstream, client:
    +46.229.168.152, server: www.nk.ca, request: "GET

    Your regexp is incorrect, as Lew pointed out, but sadly his regexp will
    have same kind of issue and even if it had been working, there had been >problem with potentially access directories that are not to ment to be >served.

    The regexp you are looking for is: ^/~([\w-]*)(/.*)?$

    Next time you have issues with regexp in nginx, take a look at >https://www.regextester.com/94055 and use the substitution section to
    see what values you really get.


    alias /usr/home/$1/html/$2;
    Why am I not getting /usr/home/html/~doctor instead of >/usr/home/doctor/html ?

    I don't think you should have the tilde in the directory name, if you
    want to change the order, then you have to change the order in your
    alias, $1 is the username, the $2 is the path, so if you have
    /user/home/html directory filled with users web directories, tne you
    should have /usr/home/html/$1/$2. If you need to keep the tilde in the >username, then you have to move the tilde in the regexp so it's inside
    the parentheses, but I recommend against that.


    location ~ .*~.*\.php$ {
    #root html;
    #try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;

    # Mitigate https://httpoxy.org/ vulnerabilities
    #fastcgi_param HTTP_PROXY "";
    fastcgi_pass unix:/var/run/php-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /usr/home/$1/html$fastcgi_script_name;
    include /usr/local/etc/nginx/fastcgi_params;
    }

    This looks really messy and another potential error source.

    location ~ \.php$ {
    try_files $uri =404;
    include fastcgi_params;
    fastcgi_pass unix:/var/run/php-fpm.sock;
    fastcgi_index index.php;
    }

    that should be neater and less prone to fail.


    PS. When you reply, remove the footer(s) if your news client don't
    manage to remove footers by itself.


    You have to wonder why apache is viewed as bloatware
    yet converting to nginx is not that straight forword

    esp when subdirectories and php gets involed.

    --

    //Aho



    --
    Member - Liberal International This is doctor@@nl2k.ab.ca Ici doctor@@nl2k.ab.ca
    Yahweh, Queen & country!Never Satan President Republic!Beware AntiChrist rising!
    Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b New Brunswick Save The PRovince Vote Liberal 14 Sept!!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J.O. Aho@21:1/5 to The Doctor on Fri Aug 21 20:16:17 2020
    XPost: comp.lang.php

    On 21/08/2020 15.21, The Doctor wrote:

    You have to wonder why apache is viewed as bloatware
    yet converting to nginx is not that straight forword

    esp when subdirectories and php gets involed.

    I would say they are quite different products and the aim has been
    different. Apache is simple to configure the defaults while nginx gives
    you a lot more freedom at the cost of more difficult configurations.

    --

    //Aho

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to J.O. Aho on Fri Aug 21 22:57:45 2020
    XPost: comp.lang.php

    In article <hqahbiFsk9oU1@mid.individual.net>,
    J.O. Aho <user@example.net> wrote:
    On 21/08/2020 15.21, The Doctor wrote:

    You have to wonder why apache is viewed as bloatware
    yet converting to nginx is not that straight forword

    esp when subdirectories and php gets involed.

    I would say they are quite different products and the aim has been
    different. Apache is simple to configure the defaults while nginx gives
    you a lot more freedom at the cost of more difficult configurations.

    --

    //Aho

    Well have you looks at Netcraft's Web Survey lately?
    --
    Member - Liberal International This is doctor@@nl2k.ab.ca Ici doctor@@nl2k.ab.ca
    Yahweh, Queen & country!Never Satan President Republic!Beware AntiChrist rising!
    Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b New Brunswick Save The PRovince Vote Liberal 14 Sept!!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to The Doctor on Sat Aug 22 02:24:18 2020
    XPost: comp.lang.php

    In article <rhpjh9$2go0$58@gallifrey.nk.ca>,
    The Doctor <doctor@doctor.nl2k.ab.ca> wrote:
    In article <hqahbiFsk9oU1@mid.individual.net>,
    J.O. Aho <user@example.net> wrote:
    On 21/08/2020 15.21, The Doctor wrote:

    You have to wonder why apache is viewed as bloatware
    yet converting to nginx is not that straight forword

    esp when subdirectories and php gets involed.

    I would say they are quite different products and the aim has been >>different. Apache is simple to configure the defaults while nginx gives
    you a lot more freedom at the cost of more difficult configurations.

    --

    //Aho

    Well have you looks at Netcraft's Web Survey lately?


    Got it to work.

    best answer:

    https://www.linode.com/community/questions/6502/nginx-php-in-a-users-public_html

    --
    Member - Liberal International This is doctor@@nl2k.ab.ca Ici doctor@@nl2k.ab.ca
    Yahweh, Queen & country!Never Satan President Republic!Beware AntiChrist rising!
    Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b New Brunswick Save The PRovince Vote Liberal 14 Sept!!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arno Welzel@21:1/5 to All on Sun Aug 23 13:50:24 2020
    XPost: comp.lang.php

    The Doctor:

    In article <hqahbiFsk9oU1@mid.individual.net>,
    J.O. Aho <user@example.net> wrote:
    On 21/08/2020 15.21, The Doctor wrote:

    You have to wonder why apache is viewed as bloatware
    yet converting to nginx is not that straight forword

    esp when subdirectories and php gets involed.

    I would say they are quite different products and the aim has been
    different. Apache is simple to configure the defaults while nginx gives
    you a lot more freedom at the cost of more difficult configurations.

    --

    //Aho

    Well have you looks at Netcraft's Web Survey lately?

    What does this have to do with the question of how difficould or easy it
    is to configure? nginx is not used because it is so simple to set up but because of its performance.


    --
    Arno Welzel
    https://arnowelzel.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to usenet@arnowelzel.de on Sun Aug 23 12:38:07 2020
    XPost: comp.lang.php

    In article <hqf3g0Fqt12U1@mid.individual.net>,
    Arno Welzel <usenet@arnowelzel.de> wrote:
    The Doctor:

    In article <hqahbiFsk9oU1@mid.individual.net>,
    J.O. Aho <user@example.net> wrote:
    On 21/08/2020 15.21, The Doctor wrote:

    You have to wonder why apache is viewed as bloatware
    yet converting to nginx is not that straight forword

    esp when subdirectories and php gets involed.

    I would say they are quite different products and the aim has been
    different. Apache is simple to configure the defaults while nginx gives
    you a lot more freedom at the cost of more difficult configurations.

    --

    //Aho

    Well have you looks at Netcraft's Web Survey lately?

    What does this have to do with the question of how difficould or easy it
    is to configure? nginx is not used because it is so simple to set up but >because of its performance.


    And that is why the competition is on.

    Anyways I answers earlier with a link.

    --
    Arno Welzel
    https://arnowelzel.de


    --
    Member - Liberal International This is doctor@@nl2k.ab.ca Ici doctor@@nl2k.ab.ca
    Yahweh, Queen & country!Never Satan President Republic!Beware AntiChrist rising!
    Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b New Brunswick Save The PRovince Vote Liberal 14 Sept!!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arno Welzel@21:1/5 to All on Mon Aug 24 02:01:41 2020
    XPost: comp.lang.php

    The Doctor:

    In article <hqf3g0Fqt12U1@mid.individual.net>,
    Arno Welzel <usenet@arnowelzel.de> wrote:
    The Doctor:

    In article <hqahbiFsk9oU1@mid.individual.net>,
    J.O. Aho <user@example.net> wrote:
    On 21/08/2020 15.21, The Doctor wrote:

    You have to wonder why apache is viewed as bloatware
    yet converting to nginx is not that straight forword

    esp when subdirectories and php gets involed.

    I would say they are quite different products and the aim has been
    different. Apache is simple to configure the defaults while nginx gives >>>> you a lot more freedom at the cost of more difficult configurations.

    --

    //Aho

    Well have you looks at Netcraft's Web Survey lately?

    What does this have to do with the question of how difficould or easy it
    is to configure? nginx is not used because it is so simple to set up but
    because of its performance.


    And that is why the competition is on.

    Did I doubt this anywhere?


    --
    Arno Welzel
    https://arnowelzel.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)