mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
feat: add REMOTE_PHP_PORT setting to configure remote PHP-FPM port
This commit is contained in:
parent
80250fdd13
commit
5e10b066ca
6 changed files with 31 additions and 17 deletions
|
|
@ -13,6 +13,7 @@
|
|||
- [FEATURE] Add the possibility to set a custom timezone for every service via the `TZ` environment variable (will apply to the logs and all date fields stored in the database). If not set, it will use the local timezone of the server.
|
||||
- [FEATURE] Add the possibility to run plugins job in async mode to avoid running them in order in the scheduler by setting the `async` key to `true` in the plugin job configuration (default is `false`)
|
||||
- [FEATURE] Add Let's Encrypt DNS challenges support !
|
||||
- [FEATURE] Add new `REMOTE_PHP_PORT` setting to control the port used by the remote PHP feature (default is 9000)
|
||||
- [SCHEDULER] Refactor the scheduler to use the `BUNKERWEB_INSTANCES` (previously known as `OVERRIDE_INSTANCES`) environment variable instead of an integration specific system
|
||||
- [AUTOCONF] Add new `NAMESPACES` environment variable to allow setting the namespaces to watch for the autoconf feature which makes it possible to use multiple autoconf instances in the same cluster while keeping the configuration separated
|
||||
- [AUTOCONF] Add new `USE_KUBERNETES_FQDN` environment variable to allow using the full qualified domain name of the services in Kubernetes instead of the ip address for the hostname of instances (default is yes)
|
||||
|
|
|
|||
|
|
@ -1310,6 +1310,7 @@ BunkerWeb supports PHP using external or remote [PHP-FPM](https://www.php.net/ma
|
|||
|
||||
- `REMOTE_PHP` : Hostname of the remote PHP-FPM instance.
|
||||
- `REMOTE_PHP_PATH` : Root folder containing files in the remote PHP-FPM instance.
|
||||
- `REMOTE_PHP_PORT` : Port of the remote PHP-FPM instance. (default: 9000)
|
||||
- `LOCAL_PHP` : Path to the local socket file of PHP-FPM instance.
|
||||
- `LOCAL_PHP_PATH` : Root folder containing files in the local PHP-FPM instance.
|
||||
|
||||
|
|
@ -1319,7 +1320,7 @@ BunkerWeb supports PHP using external or remote [PHP-FPM](https://www.php.net/ma
|
|||
|
||||
- Mount your PHP files into the `/var/www/html` folder of BunkerWeb
|
||||
- Set up a PHP-FPM container for your application and mount the folder containing PHP files
|
||||
- Use the specific settings `REMOTE_PHP` and `REMOTE_PHP_PATH` as environment variables when starting BunkerWeb
|
||||
- Use the specific settings `REMOTE_PHP`, `REMOTE_PHP_PATH` and `REMOTE_PHP_PORT` as environment variables when starting BunkerWeb
|
||||
|
||||
If you enable the [multisite mode](concepts.md#multisite-mode), you will need to create separate directories for each of your applications. Each subdirectory should be named using the first value of `SERVER_NAME`. Here is a dummy example :
|
||||
|
||||
|
|
@ -1427,7 +1428,7 @@ BunkerWeb supports PHP using external or remote [PHP-FPM](https://www.php.net/ma
|
|||
|
||||
- Mount your PHP files into the `/var/www/html` folder of BunkerWeb
|
||||
- Set up a PHP-FPM containers for your applications and mount the folder containing PHP apps
|
||||
- Use the specific settings `REMOTE_PHP` and `REMOTE_PHP_PATH` as labels for your PHP-FPM container
|
||||
- Use the specific settings `REMOTE_PHP`, `REMOTE_PHP_PATH` and `REMOTE_PHP_PORT` as labels for your PHP-FPM container
|
||||
|
||||
Since the Docker autoconf implies using the [multisite mode](concepts.md#multisite-mode), you will need to create separate directories for each of your applications. Each subdirectory should be named using the first value of `SERVER_NAME`. Here is a dummy example :
|
||||
|
||||
|
|
@ -1603,7 +1604,7 @@ BunkerWeb supports PHP using external or remote [PHP-FPM](https://www.php.net/ma
|
|||
|
||||
- Mount your PHP files into the `/var/www/html` folder of BunkerWeb
|
||||
- Set up a PHP-FPM containers for your applications and mount the folder containing PHP apps
|
||||
- Use the specific settings `REMOTE_PHP` and `REMOTE_PHP_PATH` as labels for your PHP-FPM container
|
||||
- Use the specific settings `REMOTE_PHP`, `REMOTE_PHP_PATH` and `REMOTE_PHP_PORT` as labels for your PHP-FPM container
|
||||
|
||||
Since the Swarm integration implies using the [multisite mode](concepts.md#multisite-mode), you will need to create separate directories for each of your applications. Each subdirectory should be named using the first value of `SERVER_NAME`. Here is a dummy example :
|
||||
|
||||
|
|
|
|||
|
|
@ -478,6 +478,7 @@ Manage local or remote PHP-FPM.
|
|||
| ----------------- | ------- | --------- | -------- | ------------------------------------------------------------ |
|
||||
| `REMOTE_PHP` | | multisite | no | Hostname of the remote PHP-FPM instance. |
|
||||
| `REMOTE_PHP_PATH` | | multisite | no | Root folder containing files in the remote PHP-FPM instance. |
|
||||
| `REMOTE_PHP_PORT` | `9000` | multisite | no | Port of the remote PHP-FPM instance. |
|
||||
| `LOCAL_PHP` | | multisite | no | Path to the PHP-FPM socket file. |
|
||||
| `LOCAL_PHP_PATH` | | multisite | no | Root folder containing files in the local PHP-FPM instance. |
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
{% if REMOTE_PHP != "" +%}
|
||||
{% if REMOTE_PHP != "" %}
|
||||
fastcgi_param SCRIPT_FILENAME {{ REMOTE_PHP_PATH }}/$fastcgi_script_name;
|
||||
{% elif LOCAL_PHP != "" +%}
|
||||
{% elif LOCAL_PHP != "" %}
|
||||
fastcgi_param SCRIPT_FILENAME {{ LOCAL_PHP_PATH }}/$fastcgi_script_name;
|
||||
{% else +%}
|
||||
{% else %}
|
||||
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
|
||||
{% endif %}
|
||||
fastcgi_param QUERY_STRING $query_string;
|
||||
|
|
@ -13,13 +13,14 @@ fastcgi_param CONTENT_LENGTH $content_length;
|
|||
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
fastcgi_param DOCUMENT_URI $document_uri;
|
||||
{% if REMOTE_PHP != "" +%}
|
||||
{% if REMOTE_PHP != "" %}
|
||||
fastcgi_param DOCUMENT_ROOT {{ REMOTE_PHP_PATH }};
|
||||
{% elif LOCAL_PHP != "" +%}
|
||||
{% elif LOCAL_PHP != "" %}
|
||||
fastcgi_param DOCUMENT_ROOT {{ LOCAL_PHP_PATH }};
|
||||
{% else +%}
|
||||
{% else %}
|
||||
fastcgi_param DOCUMENT_ROOT $document_root;
|
||||
{% endif %}
|
||||
|
||||
fastcgi_param SERVER_PROTOCOL $server_protocol;
|
||||
fastcgi_param REQUEST_SCHEME $scheme;
|
||||
fastcgi_param HTTPS $https if_not_empty;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
{% if REMOTE_PHP != "" or LOCAL_PHP != "" +%}
|
||||
{%- if REMOTE_PHP != "" or LOCAL_PHP != "" -%}
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
include {{ NGINX_PREFIX }}server-http/fastcgi_params;
|
||||
{% if REMOTE_PHP != "" +%}
|
||||
set $backend "{{ REMOTE_PHP }}:9000";
|
||||
fastcgi_pass $backend;
|
||||
{% elif LOCAL_PHP != "" +%}
|
||||
fastcgi_pass unix:{{ LOCAL_PHP }};
|
||||
{% if REMOTE_PHP != "" %}
|
||||
set $backend "{{ REMOTE_PHP }}:{{ REMOTE_PHP_PORT }}";
|
||||
fastcgi_pass $backend;
|
||||
{% elif LOCAL_PHP != "" %}
|
||||
fastcgi_pass unix:{{ LOCAL_PHP }};
|
||||
{% endif %}
|
||||
fastcgi_index index.php;
|
||||
fastcgi_index index.php;
|
||||
}
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,15 @@
|
|||
"regex": "^(/[\\w. \\-]+)*/?$",
|
||||
"type": "text"
|
||||
},
|
||||
"REMOTE_PHP_PORT": {
|
||||
"context": "multisite",
|
||||
"default": "9000",
|
||||
"help": "Port of the remote PHP-FPM instance.",
|
||||
"id": "remote-php-port",
|
||||
"label": "Remote PHP port",
|
||||
"regex": "^((6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([1-5][0-9]{4})|([0-5]{0,5})|([0-9]{1,4}))$",
|
||||
"type": "text"
|
||||
},
|
||||
"LOCAL_PHP": {
|
||||
"context": "multisite",
|
||||
"default": "",
|
||||
|
|
|
|||
Loading…
Reference in a new issue