reaching out to the community for some help here, reached a wall and unsure how to get passed it.
OS: Ubuntu 20.04 LTS, running docker with docker compose and portainer and pomerium with nginx using the recipe from here
config.yaml
pomerium_debug: true
address: :80
cookie_secret: cookie_secret
shared_secret: shared_secret
idp_provider: "google"
idp_provider_url: https://accounts.google.com
idp_client_id: clinet_id
idp_client_secret: client_secret
idp_service_account: idp_service_Account
insecure_server: true
#forward_auth_url: http://fwdauth.localhost.pomerium.io
forward_auth_url: http://fwdauth.domain.com
authenticate_service_url: https://authenticate.domain.com
#authenticate_service_url: https://authenticate.localhost.pomerium.io
routes:
- from: https://verify.domain.com
# - from: https://verify.localhost.pomerium.io
to: https://verify
allowed_domains:
# - pomerium.com
# - gmail.com
- numat-tech.com
pass_identity_headers: true
#routes:
# - from: https://verify.localhost.pomerium.io
# to: http://verify
# policy:
# - allowed_domains:
# or:
# - email:
# is: email
# pass_identity_headers: true
#policy:
# - from: https://verify.localhost.pomerium.io
# to: https://httpbin
# allowed_domains:
# - pomerium.com
# - gmail.com
# pass_identity_headers: true
docker-compose.yaml
version: "3"
services:
nginx:
# to emulate nginx-ingress behavior, use openresty which comes with 'escaped_request_uri'
# pre-compiled. Also uncomment lines marked `uncomment to emulate nginx-ingress behavior`
# in the nginx `.conf` configuration files.
# image: openresty/openresty
image: nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./verify.conf:/etc/nginx/conf.d/verify.conf
- ./pomerium.conf:/etc/nginx/conf.d/pomerium.conf
- ./fullchain.pem:/etc/nginx/nginx.pem
- ./privkey.pem:/etc/nginx/nginx-key.pem
# - ./_wildcard.localhost.pomerium.io.pem:/etc/nginx/nginx.pem
# - ./_wildcard.localhost.pomerium.io-key.pem:/etc/nginx/nginx-key.pem
- ./proxy.conf:/etc/nginx/proxy.conf
verify:
image: pomerium/verify
expose:
- 80
pomerium:
image: pomerium/pomerium:latest
volumes:
- ./config.yaml:/pomerium/config.yaml:ro
expose:
- 80
pomerium.conf
# Pomerium endpoint
server {
listen 443 ssl;
# server_name authenticate.localhost.pomerium.io fwdauth.localhost.pomerium.io;
server_name authenticate.domain.com fwdauth.domain.com;
ssl_certificate /etc/nginx/nginx.pem;
ssl_certificate_key /etc/nginx/nginx-key.pem;
location / {
proxy_pass http://pomerium;
include /etc/nginx/proxy.conf;
}
}
# Define an upstream so that we don't need resolvers when we use variables in proxy_pass directives
# https://stackoverflow.com/questions/17685674/nginx-proxy-pass-with-remote-addr
upstream pomerium {
server pomerium;
}
verify.conf
# Protected application
server {
listen 80;
listen 443 ssl http2;
# server_name verify.localhost.pomerium.io;
server_name domain.com;
ssl_certificate /etc/nginx/nginx.pem;
ssl_certificate_key /etc/nginx/nginx-key.pem;
location = /ext_authz {
internal;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Forwarded-Proto "";
proxy_set_header Host fwdauth.domain.com;
# proxy_set_header Host fwdauth.localhost.pomerium.io;
proxy_set_header X-Original-URL $scheme://$http_host$request_uri;
proxy_set_header X-Original-Method $request_method;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Auth-Request-Redirect $request_uri;
proxy_buffering off;
proxy_buffer_size 4k;
proxy_buffers 4 4k;
proxy_request_buffering on;
proxy_http_version 1.1;
proxy_ssl_server_name on;
proxy_pass_request_headers on;
client_max_body_size 1m;
# Pass the extracted client certificate to the auth provider
set $target http://pomerium/verify?uri=$scheme://$http_host$request_uri;
# uncomment to emulate nginx-ingress behavior
# set $target http://pomerium/verify?uri=$scheme://$http_host$request_uri&rd=$pass_access_scheme://$http_host$escaped_request_uri;
proxy_pass $target;
}
location @authredirect {
internal;
add_header Set-Cookie $auth_cookie;
# uncomment to emulate nginx-ingress behavior
# return 302 https://fwdauth.localhost.pomerium.io/?uri=$scheme://$host$request_uri&rd=$pass_access_scheme://$http_host$escaped_request_uri;
return 302
# https://fwdauth.localhost.pomerium.io/?uri=$scheme://$host$request_uri;
https://fwdauth.domain.com/?uri=$scheme://$host$request_uri;
}
location / {
proxy_pass http://verify;
include /etc/nginx/proxy.conf;
# If we get a 401, respond with a named location
error_page 401 = @authredirect;
# this location requires authentication
auth_request /ext_authz;
auth_request_set $auth_cookie $upstream_http_set_cookie;
add_header Set-Cookie $auth_cookie;
# pass JWT assertion upstream
auth_request_set $auth_resp_x_pomerium_jwt_assertion $upstream_http_x_pomerium_jwt_assertion;
proxy_set_header x-pomerium-jwt-assertion $auth_resp_x_pomerium_jwt_assertion;
}
}
when I navigate to https://verify.domain.com, I am redirected to google to sign in, and then I am being shown this and have no idea how to fix