diff --git a/rootfs/tmp/etc/nginx/nginx.conf b/rootfs/tmp/etc/nginx/nginx.conf index d8d8532..0d4d598 100644 --- a/rootfs/tmp/etc/nginx/nginx.conf +++ b/rootfs/tmp/etc/nginx/nginx.conf @@ -103,17 +103,51 @@ http { } location @api { - fastcgi_pass 127.0.0.1:9000; + fastcgi_pass unix:/run/php-fpm.sock; fastcgi_param SCRIPT_FILENAME /usr/local/share/webpanel/api/index.php; fastcgi_param REQUEST_URI $request_uri; - include fastcgi_params; + fastcgi_param QUERY_STRING $query_string; + fastcgi_param REQUEST_METHOD $request_method; + fastcgi_param CONTENT_TYPE $content_type; + fastcgi_param CONTENT_LENGTH $content_length; + fastcgi_param SCRIPT_NAME $fastcgi_script_name; + fastcgi_param DOCUMENT_URI $document_uri; + fastcgi_param DOCUMENT_ROOT $document_root; + fastcgi_param SERVER_PROTOCOL $server_protocol; + fastcgi_param REQUEST_SCHEME $scheme; + fastcgi_param HTTPS $https if_not_empty; + fastcgi_param GATEWAY_INTERFACE CGI/1.1; + fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; + fastcgi_param REMOTE_ADDR $remote_addr; + fastcgi_param REMOTE_PORT $remote_port; + fastcgi_param SERVER_ADDR $server_addr; + fastcgi_param SERVER_PORT $server_port; + fastcgi_param SERVER_NAME $server_name; + fastcgi_param REDIRECT_STATUS 200; } location ~ \.php$ { - fastcgi_pass 127.0.0.1:9000; + fastcgi_pass unix:/run/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/local/share/webpanel$fastcgi_script_name; - include fastcgi_params; + fastcgi_param QUERY_STRING $query_string; + fastcgi_param REQUEST_METHOD $request_method; + fastcgi_param CONTENT_TYPE $content_type; + fastcgi_param CONTENT_LENGTH $content_length; + fastcgi_param SCRIPT_NAME $fastcgi_script_name; + fastcgi_param DOCUMENT_URI $document_uri; + fastcgi_param DOCUMENT_ROOT $document_root; + fastcgi_param SERVER_PROTOCOL $server_protocol; + fastcgi_param REQUEST_SCHEME $scheme; + fastcgi_param HTTPS $https if_not_empty; + fastcgi_param GATEWAY_INTERFACE CGI/1.1; + fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; + fastcgi_param REMOTE_ADDR $remote_addr; + fastcgi_param REMOTE_PORT $remote_port; + fastcgi_param SERVER_ADDR $server_addr; + fastcgi_param SERVER_PORT $server_port; + fastcgi_param SERVER_NAME $server_name; + fastcgi_param REDIRECT_STATUS 200; } } @@ -123,7 +157,7 @@ http { return 404; } fastcgi_param HTTP_PROXY ""; - fastcgi_pass 127.0.0.1:9000; + fastcgi_pass unix:/run/php-fpm.sock; fastcgi_index index.php; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; diff --git a/rootfs/tmp/etc/nginx/vhosts.d/admin.conf b/rootfs/tmp/etc/nginx/vhosts.d/admin.conf deleted file mode 100644 index af07627..0000000 --- a/rootfs/tmp/etc/nginx/vhosts.d/admin.conf +++ /dev/null @@ -1,38 +0,0 @@ -server { - listen 80; - server_name admin.tor localhost; - root /usr/local/share/webpanel; - index index.php; - - access_log /data/logs/nginx/admin.access.log; - error_log /data/logs/nginx/admin.error.log; - - # Security headers - add_header X-Frame-Options "DENY" always; - add_header X-XSS-Protection "1; mode=block" always; - add_header X-Content-Type-Options "nosniff" always; - add_header Referrer-Policy "strict-origin-when-cross-origin" always; - - # PHP processing - location ~ \.php$ { - fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi_params; - } - - # Static files - location ~* \.(css|js|png|jpg|jpeg|gif|ico|svg)$ { - expires 1y; - add_header Cache-Control "public, immutable"; - } - - # Deny access to sensitive files - location ~ /\.(ht|git) { - deny all; - } - - location ~ \.(conf|log|txt)$ { - deny all; - } -} \ No newline at end of file diff --git a/rootfs/tmp/etc/php84/php-fpm.conf b/rootfs/tmp/etc/php84/php-fpm.conf index 607ebb2..8b51960 100644 --- a/rootfs/tmp/etc/php84/php-fpm.conf +++ b/rootfs/tmp/etc/php84/php-fpm.conf @@ -1,5 +1,5 @@ [global] -pid = /run/php-fpm84.pid +pid = /run/php-fpm.pid error_log = /data/logs/php-fpm/php-fpm.log log_level = notice emergency_restart_threshold = 0 @@ -10,7 +10,7 @@ daemonize = no [www] user = root group = root -listen = /run/php-fpm84.sock +listen = /run/php-fpm.sock listen.owner = root listen.group = root listen.mode = 0660