Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward proxy URI from proxy to server to let it pass to oauth2 authentication #26544

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions generators/angular/templates/webpack/webpack.custom.js.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ module.exports = async (config, options, targetOptions) => {
proxyOptions: {
changeOrigin: false, //pass the Host header to the backend unchanged https://github.com/Browsersync/browser-sync/issues/430
},
proxyReq: [
function(proxyReq) {
// URI that will be retrieved by the ForwardedHeaderFilter on the server side
mraible marked this conversation as resolved.
Show resolved Hide resolved
proxyReq.setHeader('X-Forwarded-Host', 'localhost:9000');
proxyReq.setHeader('X-Forwarded-Proto', 'https');
}
]
},
socket: {
clients: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ spring:

server:
port: <%= serverPort %>
# make sure requests the proxy uri instead of the server one
mraible marked this conversation as resolved.
Show resolved Hide resolved
forward-headers-strategy: native

# ===================================================================
# JHipster specific properties
Expand Down
Loading