Replies: 5 comments
-
@SSzretter Oqtane is multi-tenant. When Oqtane receives a request it attempts to match the Url to values that are registered in the Alias table (in the Master database). Alias values can be domain names (ie. domain.com), subdomains (www.domain.com), include port#'s (ie. domain.com:123),or include subfolders (ie. domain.com/folder). The Alias table also includes a link to the Tenant table which identifies the database where the content is stored, and a SiteId field which identifies the specific Site in the Tenant database (if you are using shared tenancy rather than isolated tenancy). The Alias table also contains an IsDefault field which indicates whether or not the request should be redirected to a default Alias. So if you shared the contents of your Alias table for your installation, it might help explain the behavior you are experiencing. |
Beta Was this translation helpful? Give feedback.
-
Hi, I have tried a few variations - if I have just the localhost entry, set as default it works locally of course. The closest I have come is having both localhost:44357 (not default) and my external dns listed (as default). Cloudflare sets up a port 443 (https) endpoint so I cant have a port after the name in the browser url. With these settings the oqtane page loads and I can click the "Login" button but nothing on the login page actually works. None of the buttons respond - its like its crashed - nothing in the app debug window or the browser console when I click buttons. If I look at the browser debug I see the errors I posed earlier where its trying to go to localhost even though the browser url is NOT localhost. While at the login screen I can click on the home, mypage and search options and the respond. Some additional info - the requests should be coming in via 'http://localhost:44357' from the cloudflare tunnel agent on the server but the app debug window shows them coming in as my external dns and "http" (not https). So I assume its getting this from the browser request and its re-writing the url. Shot of the login page load in chrome - notice the two errors where its trying to connect to localhost |
Beta Was this translation helpful? Give feedback.
-
I figured this one out - to run a blazor app behind a cloudflare tunnel you have to go to your domain, rules, page rules and create a rule for auto-minify and in my case I just turned it off completely for my tunnels public url to my app. https://stackoverflow.com/questions/75301937/blazor-server-app-behind-cloudflare-does-not-work |
Beta Was this translation helpful? Give feedback.
-
By the way, I also had to set the apiurl line 74 in ServiceBase.cs to get it to work completely since the public url is different (https) than the local url that the cloudflare agent uses (http).
Now I am able to log in and things seem to be working generally both locally on the server and remote through cloudflare. |
Beta Was this translation helpful? Give feedback.
-
I also tried a different approach that worked better - I changed the line mentioned in my previous post back (apiurl = "/") and made a change to OqtaneServiceCollectionExtensions.cs so that it will trust invalid certificates. This allows me to change my cloudflare tunnel local endpoint to HTTPS and in the app json settings I changed everything to be "https://oqtane.xxxx.com/". So now the connection from browser to cloudflare is secure (using a valid certificate) and the connection from cloudflare to oqtane via the tunnel is secure (I had to set cloudflare to also trust the invalid certificate in settings for the tunnel). I assume I could avoid the work-arounds of trusting the development certificate by installing a valid certificate. It would be good if a setting was added to oqtane for it to trust invalid certificates. |
Beta Was this translation helpful? Give feedback.
-
Hi, I am trying to get a cloudflare tunnel working to Oqtane and am having an issue due to Oqtane wanting to redirect to localhost. Cloudflare provides an https endpoint on the public internet and tunnels into the server and requests hit oqtane as 'http://localhost:port'.
I was able to get it partially working by leaving the json settings as localhost, log in and edit the site urls in the admin interface. I added a second entry of https://oqtane.xxx.com. That stopped it from redirecting me when I hit the initial page but now it wont let me log in and I see some errors in my browser console as if its trying to talk to localhost in the background.
Hoping to brainstorm some ideas on what to try next, thanks
Beta Was this translation helpful? Give feedback.
All reactions