Page 1 of 1
nginx und BackupPC
Posted: 2018-01-15 21:22
by AWOHille
Ich habe Probleme, BackupPC und nginx (1.10.3) unter Linux zum Laufen zu bekommen (siehe Anhang). fcgiwrap ist installiert. Hier noch meine nginx vhost Konfiguration
Code: Select all
server {
listen 443 ssl http2;
server_name domain.tld;
root /usr/share/backuppc/cgi-bin;
index /index.cgi;
ssl_certificate_key /etc/ssl/private/server.key;
ssl_certificate /etc/ssl/certs/server.crt;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
ssl_protocols TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/ssl/private/dhparams.pem;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m;
ssl_stapling on;
ssl_stapling_verify on;
more_set_headers 'Server: webserver';
location /backuppc {
auth_basic "BackupPC";
auth_basic_user_file /etc/backuppc/.htpasswd;
alias /usr/share/backuppc/cgi-bin/;
}
location ~\.cgi$ {
gzip off;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
fastcgi_index BackupPC_Admin;
fastcgi_param SCRIPT_FILENAME /usr/share/backuppc/cgi-bin$fastcgi_script_name;
}
}
Sämtliche Menüeinträge werden nicht geladen. Per Apache läuft die gleiche BackupPC Konfiguration problemlos. Ich habe im Moment keine Ansatz, wo ich das Problem suchen soll.
Re: nginx und BackupPC
Posted: 2018-01-15 22:09
by Joe User
Wie schaut denn die Apache-Config aus?
Re: nginx und BackupPC
Posted: 2018-01-16 08:24
by AWOHille
Code: Select all
Alias /backuppc /usr/share/backuppc/cgi-bin/
Alias /backuppc /usr/share/backuppc/cgi-bin/
<Directory /usr/share/backuppc/cgi-bin/>
AllowOverride None
Options ExecCGI FollowSymlinks
AddHandler cgi-script .cgi
DirectoryIndex index.cgi
Require all denied
AllowOverride AuthConfig
AuthUserFile /etc/backuppc/.htpasswd
AuthDigestProvider file
AuthDigestDomain /backuppc https://domain.tld/backuppc
AuthType Digest
AuthName "BackupPC"
require valid-user
</Directory>
Re: nginx und BackupPC
Posted: 2018-01-16 13:06
by Joe User
OK, sieht erstmal Beides gut aus :(
Da ich kein NGinx-User bin, habe ich mal kurz gegoogelt und dabei über diese Config gestolpert:
https://github.com/Zloy/backuppc_on_ngi ... ckuppc-ssl
Der Unterschied zu Deiner Config ist, dass Zloy die Directiven "root" und "index" im Abschnitt "location /backuppc" definiert, Du hingegen in "server".
Keine Ahnung ob das einen Unterschied macht, aber mehr konnte ich auf die Schnelle jetzt nicht finden.
Funktioniert es denn ohne SSL?
Gibt es irgendetwas Ungewöhnliches in den Logs?
Welche HTTP-Statuscodes gibt NGinx für die nicht angezeigten Ressourcen im access.log aus?
Re: nginx und BackupPC
Posted: 2018-01-16 13:16
by Joe User
Re: nginx und BackupPC
Posted: 2018-01-16 14:00
by AWOHille
Die Konfiguration hatte ich als Vorlage genutzt. Die root Anweisung in der location verursacht eine Fehlermeldung, so dass ich diese außerhalb platziert habe
Joe User wrote: ↑2018-01-16 13:06
Funktioniert es denn ohne SSL?
Leider nein
Joe User wrote: ↑2018-01-16 13:06
Gibt es irgendetwas Ungewöhnliches in den Logs?
Nein, keine Einträge vorhanden, die auf ein Problem deuten
Joe User wrote: ↑2018-01-16 13:06
Welche HTTP-Statuscodes gibt NGinx für die nicht angezeigten Ressourcen im access.log aus?
Hier liegt das Problem. Im Apache Log sind z.B. solche Zeilen vorhanden
Code: Select all
GET /backuppc/index.cgi?image=4 HTTP/1.1" 200 13036 "https://domain.tld/backuppc/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.97 Safari/537.36 Vivaldi/1.95.1064.3"
Dieser Eintrag fehlt im nginx Log komplett. Aus irgend einem Grund wird die index.cgi nicht geladen.
Re: nginx und BackupPC
Posted: 2018-01-16 15:02
by Joe User
Die Pfade in der NGinx-Config stimmen alle?
Poste bitte auch einmal die Ausgabe von
Re: nginx und BackupPC
Posted: 2018-01-16 15:38
by AWOHille
Joe User wrote: ↑2018-01-16 15:02
Die Pfade in der NGinx-Config stimmen alle?
Ja, das habe ich überprüft
Joe User wrote: ↑2018-01-16 15:02
Poste bitte auch einmal die Ausgabe von
Code: Select all
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 REQUEST_URI $request_uri;
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;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
Re: nginx und BackupPC
Posted: 2018-01-16 22:43
by Joe User
Auch OK.
Folgender Thread ab
https://bbs.archlinux.org/viewtopic.php ... 8#p1486998 könnte noch hilfreich sein.
Re: nginx und BackupPC
Posted: 2018-01-23 21:51
by AWOHille
So richtig hilft es nicht weiter, aber danke erst mal. Die Umsetzung per nginx habe ich erst mal nach hinten gestellt.
Re: nginx und BackupPC
Posted: 2018-01-23 22:31
by joneum
Ich kann mir gut vorstellen, dass es hier irgendwo Probleme mit den rechten gibt bei Dir.
Grüße
Re: nginx und BackupPC
Posted: 2018-01-25 09:05
by AWOHille
Möglich. Im Moment fällt mir aber jeglicher Ansatz, da keine weiteren Infos aus den Log Dateien zu entnehmen sind.
Re: nginx und BackupPC
Posted: 2018-01-25 12:01
by Joe User
So, nachdem ich mich nun doch mal kurz mit NGinx beschäftigt habe und mein FreeBSD HowTo entsprechend erweitert habe, habe ich Dir auch mal einen meiner Meinung nach etwas optimierten VHost-Container erstellt.
Code: Select all
server {
listen 443 ssl http2;
server_name www.example.com;
resolver 127.0.0.1;
ssl_stapling on;
ssl_stapling_verify on;
ssl_session_tickets off;
ssl_session_timeout 10m;
ssl_session_cache shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+ECDSA+CHACHA20:EECDH+CHACHA20:EECDH+ECDSA+AESGCM+AES256:EECDH+AESGCM+AES256:EECDH+ECDSA+AESGCM+AES128:EECDH+AESGCM+AES128:EECDH+ECDSA+AES256+SHA384:EECDH+AES256+SHA384:EECDH+ECDSA+AES128+SHA256:EECDH+AES128+SHA256:EECDH+ECDSA+AES256+SHA1:EECDH+AES256+SHA1:EECDH+ECDSA+AES128+SHA1:EECDH+AES128+SHA1:EDH+CHACHA20:EDH+AESGCM+AES256:EDH+AESGCM+AES128:EDH+AES256+SHA256:EDH+AES128+SHA256:EDH+AES256+SHA1:EDH+AES128+SHA1:!CAMELLIA:!SEED:!IDEA:!RC2:!RC4:!3DES:!DES:!kRSA:!kSRP:!kPSK:!kGOST:!kECDHr:!kECDHe:!kDHr:!kDHd:!aDSS:!aNULL:!eNULL:!MEDIUM:!LOW:!EXPORT;
ssl_prefer_server_ciphers on;
ssl_certificate /etc/ssl/certs/server.crt;
ssl_certificate_key /etc/ssl/private/server.key;
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
add_header Access-Control-Allow-Origin "*";
add_header Access-Control-Max-Age "600";
add_header Upgrade-Insecure-Requests "1";
add_header Referrer-Policy "origin-when-cross-origin";
add_header Content-Security-Policy "upgrade-insecure-requests; referrer origin-when-cross-origin; default-src 'self' 'unsafe-inline' 'unsafe-eval' https: wss: data: blob: filesystem:; form-action 'self' https: wss:; frame-ancestors 'self'; sandbox allow-forms allow-modals allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation";
add_header X-Content-Security-Policy "upgrade-insecure-requests; referrer origin-when-cross-origin; default-src 'self' 'unsafe-inline' 'unsafe-eval' https: wss: data: blob: filesystem:; form-action 'self' https: wss:; frame-ancestors 'self'; sandbox allow-forms allow-modals allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation";
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
add_header X-XSS-Protection "1; mode=block";
add_header X-DNS-Prefetch-Control "on";
add_header X-UA-Compatible "IE=Edge";
add_header Timing-Allow-Origin "*";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
location / {
root /usr/share/backuppc/cgi-bin;
index index.cgi;
}
location /backuppc {
index index.cgi;
auth_basic "BackupPC";
auth_basic_user_file /etc/backuppc/.htpasswd;
alias /usr/share/backuppc/cgi-bin;
}
location ~ ^(.+\.cgi)(.*)$ {
gzip off;
root /usr/share/backuppc/cgi-bin;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
fastcgi_index BackupPC_Admin;
fastcgi_split_path_info ^(.+\.cgi)(.*)$;
fastcgi_param SCRIPT_FILENAME /usr/share/backuppc/cgi-bin$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include /etc/nginx/fastcgi_params;
}
}
Mit sehr viel Gück behebt das so gar schon Dein Problem, viel Hoffnung habe ich allerdings nicht.
Re: nginx und BackupPC
Posted: 2018-01-28 22:31
by AWOHille
Habe das nun mal getestet, hat leider keine Änderungen gebracht. Danke aber trotzdem für deine Mühe.
Re: nginx und BackupPC
Posted: 2018-01-29 02:06
by Joe User
Keine Änderung in den Logs?
Drehe mal den Debuglevel im NGinx rauf.