Hello.
I'm experiencing a strange problem in my FreeBSD 11.1 jailed web server.
4 hours ago I needed to replace the hard drive of my home server, because was broken and I reinstalled FreeBSD with exactly the same config before hard drive change, where the jailed server was doing the work so well.
All the base/network hardware are the really same, even the same software installed.
Jailed server:
Apache24
NGINX as reverse proxy
MariaDB
PHP 7.1
Varnish
Now, the problems appeared...
I can load HTML pages with no trouble: https://venenonegro.tk/
But, index.php files doesn't work: https://rootmaster.tk/
Even if I try to load phpmyadmin (for example) it loads with only raw code, no kind of correct rendering.
These two domains have their own NGINX vhost to separate directories. Permissions and directives are correct.
Sounds like some kind of trouble with PHP, but I don't sure, because before the system reinstall, all was working flawlessly.
Back to server config, there's the nginx.conf:
Now, the proxy.conf:
That's one of my vhosts:
The following are in the Includes/php.conf of Apache:
What's wrong here?
Thanks for the help
I'm experiencing a strange problem in my FreeBSD 11.1 jailed web server.
4 hours ago I needed to replace the hard drive of my home server, because was broken and I reinstalled FreeBSD with exactly the same config before hard drive change, where the jailed server was doing the work so well.
All the base/network hardware are the really same, even the same software installed.
Jailed server:
Apache24
NGINX as reverse proxy
MariaDB
PHP 7.1
Varnish
Now, the problems appeared...
I can load HTML pages with no trouble: https://venenonegro.tk/
But, index.php files doesn't work: https://rootmaster.tk/
Even if I try to load phpmyadmin (for example) it loads with only raw code, no kind of correct rendering.
These two domains have their own NGINX vhost to separate directories. Permissions and directives are correct.
Sounds like some kind of trouble with PHP, but I don't sure, because before the system reinstall, all was working flawlessly.
Back to server config, there's the nginx.conf:
Code:
user www;
worker_processes 1;
error_log /var/log/nginx/error.log;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log;
sendfile on;
keepalive_timeout 65;
# Nginx cache configuration
proxy_cache_path /var/nginx/cache levels=1:2 keys_zone=my-cache:8m max_size=1000m inactive=600m;
proxy_temp_path /var/nginx/cache/tmp;
proxy_cache_key "$scheme$host$request_uri";
gzip on;
server {
listen 80;
server_name (my server name);
location /nginx_status {
stub_status on;
access_log off;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/local/www/nginx-dist;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:8080
#
location ~ \.php$ {
proxy_pass http://127.0.0.1:8080;
include /usr/local/etc/nginx/proxy.conf;
}
}
include /usr/local/etc/nginx/vhost/*;
}
Now, the proxy.conf:
Code:
proxy_buffering on;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 100 8k;
add_header X-Cache $upstream_cache_status;
That's one of my vhosts:
Code:
server {
# Replace with your FreeBSD Server IP
listen my_server_ip:80;
# Document Root
root /usr/local/www/apache24/data/;
index index.php index.html index.htm;
# Domain
server_name www.mydomain.com mydomain.com;
# Error and Access log file
error_log /var/log/nginx/mydomain-error.log;
access_log /var/log/nginx/mydomain-access.log main;
# Reverse Proxy Configuration
location ~ \.php$ {
proxy_pass http://127.0.0.1:8080;
include /usr/local/etc/nginx/proxy.conf;
# Cache configuration
proxy_cache my-cache;
proxy_cache_valid 10s;
proxy_no_cache $cookie_PHPSESSID;
proxy_cache_bypass $cookie_PHPSESSID;
proxy_cache_key "$scheme$host$request_uri";
}
# Disable Cache for the file type html, json
location ~* .(?:manifest|appcache|html?|xml|json)$ {
expires -1;
}
# Enable Cache the file 30 days
location ~* .(jpg|png|gif|jpeg|css|mp3|wav|swf|mov|doc|pdf|xls|ppt|docx|pptx|xlsx)$ {
proxy_cache_valid 200 120m;
expires 30d;
proxy_cache my-cache;
access_log off;
}
}
The following are in the Includes/php.conf of Apache:
Code:
<IfModule dir_module>
DirectoryIndex index.php index.html
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
</IfModule>
What's wrong here?
Thanks for the help