mirror of
https://github.com/casjaysdevdocker/tor
synced 2025-10-14 08:02:34 -04:00
🗃️ Committing everything that changed 🗃️
Dockerfile README.md rootfs/tmp/etc/nginx/nginx.conf rootfs/tmp/etc/nginx/vhosts.d/admin.conf rootfs/usr/local/bin/entrypoint.sh rootfs/usr/local/etc/docker/init.d/99-php-fpm.sh rootfs/usr/local/share/
This commit is contained in:
@@ -92,6 +92,31 @@ http {
|
||||
stub_status;
|
||||
}
|
||||
|
||||
# Admin panel access
|
||||
location ^~ /admin {
|
||||
alias /usr/local/share/webpanel;
|
||||
index index.php;
|
||||
|
||||
# REST API routing
|
||||
location ^~ /admin/api/ {
|
||||
try_files $uri $uri/ @api;
|
||||
}
|
||||
|
||||
location @api {
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
fastcgi_param SCRIPT_FILENAME /usr/local/share/webpanel/api/index.php;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME /usr/local/share/webpanel$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
}
|
||||
|
||||
location ~ [^/]\.php(/|$) {
|
||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||
if (!-f $document_root$fastcgi_script_name) {
|
||||
|
38
rootfs/tmp/etc/nginx/vhosts.d/admin.conf
Normal file
38
rootfs/tmp/etc/nginx/vhosts.d/admin.conf
Normal file
@@ -0,0 +1,38 @@
|
||||
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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user