Fix u2f with nginx rp
This commit is contained in:
parent
d6cdc846d8
commit
e2dc15774f
@ -26,8 +26,7 @@ require_once 'inc/lib/Yubico.php';
|
|||||||
|
|
||||||
// U2F API
|
// U2F API
|
||||||
require_once 'inc/lib/U2F.php';
|
require_once 'inc/lib/U2F.php';
|
||||||
$scheme = isset($_SERVER['HTTPS']) ? "https://" : "http://";
|
$u2f = new u2flib_server\U2F('https://' . $_SERVER['HTTP_HOST']);
|
||||||
$u2f = new u2flib_server\U2F($scheme . $_SERVER['HTTP_HOST']);
|
|
||||||
|
|
||||||
// PDO
|
// PDO
|
||||||
$dsn = "$database_type:host=$database_host;dbname=$database_name";
|
$dsn = "$database_type:host=$database_host;dbname=$database_name";
|
||||||
|
@ -3,8 +3,7 @@ require_once('inc/prerequisites.inc.php');
|
|||||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||||
$pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
|
$pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
|
||||||
|
|
||||||
$scheme = isset($_SERVER['HTTPS']) ? "https://" : "http://";
|
$u2f = new u2flib_server\U2F('https://' . $_SERVER['HTTP_HOST']);
|
||||||
$u2f = new u2flib_server\U2F($scheme . $_SERVER['HTTP_HOST']);
|
|
||||||
|
|
||||||
function getRegs($username) {
|
function getRegs($username) {
|
||||||
global $pdo;
|
global $pdo;
|
||||||
|
@ -83,6 +83,7 @@ HTTP_PORT=8080
|
|||||||
HTTPS_PORT=127.0.0.1
|
HTTPS_PORT=127.0.0.1
|
||||||
HTTPS_PORT=8443
|
HTTPS_PORT=8443
|
||||||
```
|
```
|
||||||
|
** IMPORTANT: Do not use port 8081 **
|
||||||
|
|
||||||
Recreate affected containers by running `docker-compose up -d`.
|
Recreate affected containers by running `docker-compose up -d`.
|
||||||
|
|
||||||
@ -125,6 +126,7 @@ server {
|
|||||||
location / {
|
location / {
|
||||||
proxy_pass http://127.0.0.1:8080/;
|
proxy_pass http://127.0.0.1:8080/;
|
||||||
proxy_redirect http://127.0.0.1:8080/ $scheme://$host:$server_port/;
|
proxy_redirect http://127.0.0.1:8080/ $scheme://$host:$server_port/;
|
||||||
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
Loading…
Reference in New Issue
Block a user