PiranhaCMS / piranha.core.docs

Official documentation for Piranha CMS
MIT License
12 stars 51 forks source link

Unable to access manager pages when using Nginx #40

Open azureskydiver opened 4 years ago

azureskydiver commented 4 years ago

I followed the 5 minute startup guide on the front page of https://piranhacms.org/ and then started working my way through the steps on Microsoft's Host ASP.NET Core on Linux with Nginx. I got as far as Configure Nginx step.

I could launch the app and get to the main content pages, but trying to access the manager pages at (~/manager) would fail to login. I could get as far as the login page, but after entering the out of the box user name and password, Nginx would return a 403 error. After enabling error logging, I discovering that the app was sending too big a header, I used this blog to resolve the issue: Nginx Proxy: upstream sent too big header while reading response header from upstream

Ironically, I should have pushed through with the rest of Microsoft's page because they later make mention of long request headers and changing buffer sizes, as well as the Microsoft's hardening steps also changes the buffer sizes.

The CMS documentation should make special mention about setting the buffer sizes for Nginx if the users are planning on using it as their reverse proxy.

tidyui commented 4 years ago

Hi there! I think some people have discussed this earlier at our Gitter chat! I’ll move this issue over to our documentation repo so we don’t forget about it!

Best regards

azureskydiver commented 4 years ago

I only saw the discussion regarding the X-Forwarded-For modifications that needed to be applied to the Startup.cs. I believe that was from Dec 19, 2019. The last I saw was that you were thinking that Nginx was doing something about the "/manager" path. Someone said that their workaround was to disable CORS in their browser. It's why I opened this issue when I finally found a way to make it work without having to resort to using disabling CORS in their browser.

Anyway, if the buffer size thing can be put into the documentation, I'm quite sure that it will save someone else a lot of time and headaches.