Skip to content

Support reverse proxy the NextCloud way - #318

Open
Toilal wants to merge 2 commits into
nextcloud:masterfrom
Toilal:reverse-proxy-fix
Open

Support reverse proxy the NextCloud way#318
Toilal wants to merge 2 commits into
nextcloud:masterfrom
Toilal:reverse-proxy-fix

Conversation

@Toilal

Copy link
Copy Markdown

In some network configurations involving a reverse proxy, the base url generated by the underlying SAML library is not consistent with the way it's generated in NextCloud.

For example, it may generate http:// urls instead of https:// when the SSL Layer is handled by a proxy, even when NextCloud URLGenerator#getAbsoluteURL effectively generates https:// urls.

This change setup SAML library to use the Server Protocol and Server Host as returned by the NextCloud Request object to build SAML urls properly.

@Toilal
Toilalforce-pushed the reverse-proxy-fix branch from 9c2773d to 2c4669aCompareApril 5, 2019 08:41
@schiessle
schiessle requested review from blizzz and rullzerApril 15, 2019 08:44
@hairmare

Copy link
Copy Markdown

Safari and Firefox both seem to currently display a security warning due to http only URLs in some redirects. It looks like this PR would fix the issue.

@rullzer
rullzer requested a review from schiessleMay 28, 2019 20:07
@rullzer

Copy link
Copy Markdown
Member

Right. It makes sense... let me see if I can do a test setup with this.

@Toilal
Toilalforce-pushed the reverse-proxy-fix branch 2 times, most recently from f293513 to 17a24e5CompareJune 8, 2019 22:36
@Toilal

Copy link
Copy Markdown
Author

I have rebased on current master. @rullzer Have you made some tests with those changes ?

@blizzz
blizzzforce-pushed the reverse-proxy-fix branch from 17a24e5 to ed2b533CompareMay 2, 2025 09:42
@blizzz

Copy link
Copy Markdown
Member

I am going through the open PRs and a there is a bunch of dusty ones here 😅

Rebased this one. I understand this is still relevant.

In some network configurations involving a reverse proxy, the base url generated by the underlying SAML library is not consistent with the way it's generated in NextCloud.
For example, it may generate `http://` urls instead of `https://` when the SSL Layer is handled by a proxy, even when NextCloud URLGenerator#getAbsoluteURL effectively generates `https://` urls.
This change setup SAML library to use the Server Protocol and Server Host as returned by the NextCloud Request object to build SAML urls properly.
Signed-off-by: Rémi Alvergnat <remi.alvergnat@gfi.fr>
@blizzz
blizzzforce-pushed the reverse-proxy-fix branch from ed2b533 to 5717612CompareMay 2, 2025 09:57
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
@CarlSchwan
CarlSchwan self-requested a review as a code ownerJune 1, 2026 12:20
@CarlSchwanCarlSchwan added this to the 8.2.0 milestone Jun 1, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@Toilal@hairmare@rullzer@blizzz@CarlSchwan