Hi,
after I was able to setup a nginx reverse proxy in jail to serve traffic for other jails I am stuck at another point:
Nginx+Mysql+PHP in one jail works perfect for one website(and probably for more than 1). But the point of jails is that we want to run one site or one application in one jail. As it is known if we install multiple instances of mysql in multiple jails it will eat the server memory fast, so I tried to install PHP and MYSQL in a jail and NGINX with site contents in another jail(several sites, several jails with nginx only, all of them using the single php-mysql jail)
As I read around there are two ways of configuring php and mysql in separate jails: by using mount_nullfs and by using nginx proxy at the network level. I have read that the solution using mount_nullfs might be faster cause it uses sockets for talking. I didn't give a try to this solution because I am using bastille jails and do not know how to mount directories from jail to jail(they provide only command for mounting host to jail). Therefor I tried the solution with nginx as proxy but it gives me a headache and cant have the php to talk to nginx at all. So far I didn't went further to mysql cause I am still stuck with php.
Appreciate if someone cand draw a nginx config example and a www.conf on php side and php.ini if there is necessary. It looks that the root directory which I set on nginx side can't be read by php side.
my nginx reads like this(nginx jail has IP 10.0.0.1 and php-mysql 10.0.0.4):
I also set in www.conf on php jail the listen 10.0.0.4:9000 and listen.allowed_clients 10.0.0.1
with the above config I get the error "no input file specified"
If I play around with root path I get 404
after I was able to setup a nginx reverse proxy in jail to serve traffic for other jails I am stuck at another point:
Nginx+Mysql+PHP in one jail works perfect for one website(and probably for more than 1). But the point of jails is that we want to run one site or one application in one jail. As it is known if we install multiple instances of mysql in multiple jails it will eat the server memory fast, so I tried to install PHP and MYSQL in a jail and NGINX with site contents in another jail(several sites, several jails with nginx only, all of them using the single php-mysql jail)
As I read around there are two ways of configuring php and mysql in separate jails: by using mount_nullfs and by using nginx proxy at the network level. I have read that the solution using mount_nullfs might be faster cause it uses sockets for talking. I didn't give a try to this solution because I am using bastille jails and do not know how to mount directories from jail to jail(they provide only command for mounting host to jail). Therefor I tried the solution with nginx as proxy but it gives me a headache and cant have the php to talk to nginx at all. So far I didn't went further to mysql cause I am still stuck with php.
Appreciate if someone cand draw a nginx config example and a www.conf on php side and php.ini if there is necessary. It looks that the root directory which I set on nginx side can't be read by php side.
my nginx reads like this(nginx jail has IP 10.0.0.1 and php-mysql 10.0.0.4):
Code:
server {
listen 10.0.0.1:443 ssl http2;
# listen [::]:443 ssl http2;
server_name example.com;
root usr/local/www/example.com;
index index.php;
ssl_certificate /usr/local/etc/letsencrypt/live/example.com/fullchain.pem
ssl_certificate_key /usr/local/etc/letsencrypt/live/example.com/privkey.pem
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 10.0.0.4:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
with the above config I get the error "no input file specified"
If I play around with root path I get 404