try proxy redirect

This commit is contained in:
Karol Wypchlo 2020-12-15 18:00:10 +01:00
parent 393025befc
commit 1cf160b988
5 changed files with 20 additions and 24 deletions

View File

@ -227,7 +227,7 @@ services:
environment: environment:
- DSN=cockroach://root@cockroach:26257/defaultdb?sslmode=disable&max_conns=20&max_idle_conns=4 - DSN=cockroach://root@cockroach:26257/defaultdb?sslmode=disable&max_conns=20&max_idle_conns=4
- LOG_LEVEL=trace - LOG_LEVEL=trace
- SERVE_PUBLIC_BASE_URL=https://siasky.xyz/secure/.ory/kratos/public/ - SERVE_PUBLIC_BASE_URL=http://127.0.0.1/secure/.ory/kratos/public/
- SQA_OPT_OUT=true - SQA_OPT_OUT=true
command: serve -c /etc/config/kratos/kratos.yml command: serve -c /etc/config/kratos/kratos.yml
volumes: volumes:
@ -256,8 +256,8 @@ services:
- PORT=4435 - PORT=4435
- SECURITY_MODE=jwks - SECURITY_MODE=jwks
- PROJECT_NAME=Skynet - PROJECT_NAME=Skynet
- BASE_URL=https://siasky.xyz/secure/ - BASE_URL=http://127.0.0.1/secure/
- KRATOS_BROWSER_URL=https://siasky.xyz/secure/.ory/kratos/public - KRATOS_BROWSER_URL=http://127.0.0.1/secure/.ory/kratos/public
- JWKS_URL=http://oathkeeper:4456/.well-known/jwks.json - JWKS_URL=http://oathkeeper:4456/.well-known/jwks.json
- KRATOS_PUBLIC_URL=http://kratos:4433/ - KRATOS_PUBLIC_URL=http://kratos:4433/
- KRATOS_ADMIN_URL=http://kratos:4434/ - KRATOS_ADMIN_URL=http://kratos:4434/

View File

@ -4,16 +4,16 @@ dsn: memory
serve: serve:
public: public:
base_url: https://siasky.xyz/secure/ base_url: http://127.0.0.1/secure/
cors: cors:
enabled: true enabled: true
admin: admin:
base_url: https://siasky.xyz/admin/ base_url: http://127.0.0.1/admin/
selfservice: selfservice:
default_browser_return_url: https://siasky.xyz default_browser_return_url: http://127.0.0.1/
whitelisted_return_urls: whitelisted_return_urls:
- https://siasky.xyz - http://127.0.0.1/
methods: methods:
password: password:
@ -21,33 +21,33 @@ selfservice:
flows: flows:
error: error:
ui_url: https://siasky.xyz/secure/error ui_url: http://127.0.0.1/secure/error
settings: settings:
ui_url: https://siasky.xyz/secure/settings ui_url: http://127.0.0.1/secure/settings
privileged_session_max_age: 15m privileged_session_max_age: 15m
recovery: recovery:
enabled: true enabled: true
ui_url: https://siasky.xyz/secure/recovery ui_url: http://127.0.0.1/secure/recovery
verification: verification:
enabled: true enabled: true
ui_url: https://siasky.xyz/secure/verify ui_url: http://127.0.0.1/secure/verify
after: after:
default_browser_return_url: https://siasky.xyz default_browser_return_url: http://127.0.0.1/
logout: logout:
after: after:
default_browser_return_url: https://siasky.xyz/secure/auth/login default_browser_return_url: http://127.0.0.1/secure/auth/login
login: login:
ui_url: https://siasky.xyz/secure/auth/login ui_url: http://127.0.0.1/secure/auth/login
lifespan: 10m lifespan: 10m
registration: registration:
lifespan: 10m lifespan: 10m
ui_url: https://siasky.xyz/secure/auth/registration ui_url: http://127.0.0.1/secure/auth/registration
after: after:
password: password:
hooks: hooks:

View File

@ -50,8 +50,7 @@
errors: errors:
- handler: redirect - handler: redirect
config: config:
#to: http://oathkeeper:4455/auth/login to: http://127.0.0.1/secure/auth/login
to: https://siasky.xyz/secure/auth/login
- id: "accounts" - id: "accounts"
upstream: upstream:

View File

@ -30,11 +30,9 @@ errors:
redirect: redirect:
enabled: true enabled: true
config: config:
#to: http://oathkeeper:4455/auth/login to: http://127.0.0.1/secure/auth/login
to: https://siasky.xyz/secure/auth/login
when: when:
- - error:
error:
- unauthorized - unauthorized
- forbidden - forbidden
request: request:
@ -81,11 +79,9 @@ mutators:
id_token: id_token:
enabled: true enabled: true
config: config:
#issuer_url: http://oathkeeper:4455/ issuer_url: http://oathkeeper:4455/
issuer_url: https://siasky.xyz/
jwks_url: file:///etc/config/oathkeeper/id_token.jwks.json jwks_url: file:///etc/config/oathkeeper/id_token.jwks.json
claims: | claims: |
{ {
"session": {{ .Extra | toJson }} "session": {{ .Extra | toJson }}
} }

View File

@ -349,6 +349,7 @@ server {
location /secure { location /secure {
rewrite /secure/(.*) /$1 break; rewrite /secure/(.*) /$1 break;
proxy_redirect http://127.0.0.1/ /;
proxy_pass http://oathkeeper:4455; proxy_pass http://oathkeeper:4455;
} }