Basic Nginx Server's PHP option.

  • Hi,


    I had set up several web servers in OMV, and they're working fine.
    However, I want to understand a little more about the PHP option in Nginx option.
    How do I know when to use this option or not: PHP>>Enable PHP and Default config


    Do I enable it if I create my own pool such as NextCloud or if I use something like this, then I don't need it?
    fastcgi_pass unix:/var/run/php5-fpm.sock;

  • https://github.com/OpenMediaVa…nx.d/90-nginx-server#L158


    checkout source code


    enable_php option means

    Code
    set $socket "unix:/var/run/fpm-$php_pool_ref.sock";


    php_use_default_config means

    Code
    {
    location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass $socket;
    }

    OMV3 on Proxmox
    Intel E3-1245 v5 | 32GB ECC RAM | 4x3TB RAID10 HDD
    omv-zfs | omv-nginx | omv-letsencrypt | omv-openvpn
    Click link for more details

  • $php_pool_ref is pool you selected in PHP-FPM pool option
    you can manage your fpm pool in Pools tab

    OMV3 on Proxmox
    Intel E3-1245 v5 | 32GB ECC RAM | 4x3TB RAID10 HDD
    omv-zfs | omv-nginx | omv-letsencrypt | omv-openvpn
    Click link for more details

  • Ok. From what I understand is if I use the php-fpm-pool, then it will set the socket as $socket.
    The $socket is then pass as a variable to php_use_default_config.
    But the php_use_default_config is also allow me to use my own socket if it's unchecked.


    If I put this code in the vhost extra options: fastcgi_pass unix:/var/run/php5-fpm.sock, then I don't need to enable it right?

    OMV v5.0
    Asus Z97-A/3.1; i3-4370
    32GB RAM Corsair Vengeance Pro

  • Ok. From what I understand is if I use the php-fpm-pool, then it will set the socket as $socket.
    The $socket is then pass as a variable to php_use_default_config.
    But the php_use_default_config is also allow me to use my own socket if it's unchecked.

    if I use the php-fpm-pool -> if I use `Enable php` option


    php_use_default_config option control how nginx handle .php extenstions
    for example, if you want to use .ppp extenstions
    turn off this option, and write


    Code
    {
    location ~ \.ppp$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass $socket;
    }


    if you set vhost extra options like

    Code
    fastcgi_pass unix:/var/run/php5-fpm.sock

    you don't need to enable both `enable php` and `default config`
    By default, openmediavault have /var/run/php5-fpm which is not seen omv-nginx pools tab (hidden)
    checkout

    Code
    vim /etc/php5/fpm/pool.d/www.conf

    OMV3 on Proxmox
    Intel E3-1245 v5 | 32GB ECC RAM | 4x3TB RAID10 HDD
    omv-zfs | omv-nginx | omv-letsencrypt | omv-openvpn
    Click link for more details

  • Generally, seperating socket is recommended for security reason
    Also if one socket is blocked then sites using that socket will be also blocked


    there are two sockets by default in omv
    one is /var/run/php5-fpm-openmediavault-webgui.sock (for openmediavault website)
    the other is /var/run/php5-fpm.sock (this is installed by debian php package)
    so, if you uses php5-fpm socket, omv site is already seperated


    I don't think you don't have to seperate anymore for personal uses

    OMV3 on Proxmox
    Intel E3-1245 v5 | 32GB ECC RAM | 4x3TB RAID10 HDD
    omv-zfs | omv-nginx | omv-letsencrypt | omv-openvpn
    Click link for more details

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!