Publishing Squidex inside a subfolder in IIS


#1

I’m trying to publish Squidex inside another project, so in production I could access Squidex via www.myproject.com/cms. I’ve been trying all day and had no luck, honestly I don’t know if this is an issue with squidex or my IIS configuration, if someone had done something like this, I would like to hear about your experience.

The issue that I think I have is that when I access myproject.com/cms I have 404 errors on my network log, like it’s trying to access squidex stuff in the parent directory instead of the child (squidex) directory.

It should try to access www.dnndev.me/inner/images/ instead.

I added the “sub project” as an aplication of the parent one in IIS

If someone could help me out, I would really appreciate it.
Thanks


#2

If you view the source code in the browser what is the base path, e.g <base href="/">


#3
exactly that one

#4

You can try to set it to your inner subpath. The file is located somewhere in the build folder. I think wwwroot/build/index.html.


#5

I did that but the requests keep trying to access the outter folder: http://www.dnndev.me/build/app
instead of http://www.dnndev.me/inner/build/app.

I changed in my index.html base to “http://www.dnndev.me/inner


#6

I think it should be /inner/


#7

I would just use a subdomain. I have never used folders since years, because it makes so much troubles with cookies and so on.


#8

Yes, it is, I fixed it but no luck


#9

Yeah, I sugested doing it that way, but apparently is not the “right way” to do it. That’s what I was told here at work


#10

With webpack it is a little bit complicated. It generates urls starting with slash and therefore the base path has no real effect.

It can definitely be solved but it has no high priority for me. But PRs are welcome :wink:

EDIT: I might have a simple solution, will check that.


#11

I have pushed a potential fix, but could not try it yet.


#12

I’ve been trying, no luck :persevere:


#13

What exactly happened? Has the base href folder replaced correctly?


#14

Im publishing the subfolder the same way I was doing with the last one (now i called it publish) but im having this error, I think I have some missing settings or something, but I did exactly the same as before and im having a different output. base href set to /publish/ and al local directory references changed from inner to publish.


#15

You should be able to find more infos in the log.


#16

I pushed a new version.


#17

So Sebastian, I published the new version and im getting the Squidex landing page (the one with the login button) Great advance :slight_smile: but im getting invalid redirect_uri on the login pop-up.

{
“logLevel”: “Error”,
“message”: “Invalid redirect_uri: http://localhost/squidex/client-callback-popup\n{\r\n “ClientId”: “squidex-frontend”,\r\n “ClientName”: “squidex-frontend”,\r\n “AllowedRedirectUris”: [\r\n “http://localhost/login;”,\r\n “http://localhost/client-callback-silent”,\r\n “http://localhost/client-callback-popup”\r\n ],\r\n “SubjectId”: “anonymous”,\r\n “RequestedScopes”: “”,\r\n “Raw”: {\r\n “client_id”: “squidex-frontend”,\r\n “redirect_uri”: “http://localhost/squidex/client-callback-popup”,\r\n “response_type”: “id_token token”,\r\n “scope”: “squidex-api openid profile email squidex-profile role permissions”,\r\n “state”: “6cb281bce0114acabbc1cea27c35fed6”,\r\n “nonce”: “ad65e09f6c3540438fee10f0acca3d4d”,\r\n “display”: “popup”\r\n }\r\n}”,
“detail”: “http://localhost/squidex/client-callback-popup”,
@requestDetails”: “{\r\n “ClientId”: “squidex-frontend”,\r\n “ClientName”: “squidex-frontend”,\r\n “AllowedRedirectUris”: [\r\n “http://localhost/login;”,\r\n “http://localhost/client-callback-silent”,\r\n “http://localhost/client-callback-popup”\r\n ],\r\n “SubjectId”: “anonymous”,\r\n “RequestedScopes”: “”,\r\n “Raw”: {\r\n “client_id”: “squidex-frontend”,\r\n “redirect_uri”: “http://localhost/squidex/client-callback-popup”,\r\n “response_type”: “id_token token”,\r\n “scope”: “squidex-api openid profile email squidex-profile role permissions”,\r\n “state”: “6cb281bce0114acabbc1cea27c35fed6”,\r\n “nonce”: “ad65e09f6c3540438fee10f0acca3d4d”,\r\n “display”: “popup”\r\n }\r\n}”,
“app”: {
“name”: “Squidex”,
“version”: “1.0.0.0”,
“sessionId”: “d7aa23be-6b79-4035-b27d-6979175858c6”
},
“web”: {
“requestId”: “467da888-3180-4a48-a050-d5f51d488010”,
“requestPath”: “/connect/authorize”,
“requestMethod”: “GET”
},
“timestamp”: “2019-04-08T17:59:58Z”,
“category”: “IdentityServer4.Validation.AuthorizeRequestValidator”
}

{
“logLevel”: “Error”,
“message”: “Request validation failed”,
“app”: {
“name”: “Squidex”,
“version”: “1.0.0.0”,
“sessionId”: “d7aa23be-6b79-4035-b27d-6979175858c6”
},
“web”: {
“requestId”: “467da888-3180-4a48-a050-d5f51d488010”,
“requestPath”: “/connect/authorize”,
“requestMethod”: “GET”
},
“timestamp”: “2019-04-08T17:59:58Z”,
“category”: “IdentityServer4.Endpoints.AuthorizeEndpoint”
}

Maybe the IDP is not redirecting? I assume that’s the issue. I tried to change the redirection url myself but Im having issues publishing a self built squidex project instead of the binaries uploaded to GitHub.


#18

Fixed, I changed the base url on the appsettings.json but not the production one, Thanks a lot for the help.


#19

Awesome, great that it works :slight_smile: