It is the expected behavior that the first backend access is redirected to “backend/site/login” because the backend index page requires a valid user login. Did you register some user in the frontend? Try to register some user in the frontend and login with it, then you will be able to access the backend index page.
When you take the 1st method, there should be no need to do extra nginx configurations for the backend. You should be able to think that there’s only frontend, no backend at all.
What do you mean by “it”? Is it a valid URL like "http://domain.com/backend" or an invalid URL like "http://domain.com/backend/web"? It’s very natural that an invalid URL ends in a 404 error.
My apologies for not being clear. The url shows domain.com/backend/site/login however, what is actually displayed is a blank 404 Not Found page (nginx/1.20.0)
This is for apache. I actually had no problem getting this setup in apache on my local machine, but I’d like to run nginx for full deployment.
Alright, just pulled the nginx error.log. This is what it shows:
2021/09/07 04:01:02 [error] 5643#5643: *98 open() "/var/www/html/frontend/web/backend/site/login" failed (2: No such file or directory), client: 45.17.74.222, server: , request: "GET /backend/site/login HTTP/1.1", host: "rof-env.eba-w4zn6ugp.us-east-2.elasticbeanstalk.com"
As you can see, it’s simply appending backend/site/login. This is using method 1 with a simple symbolic link. I had noticed this before and is why I went with method 2 (and others like it).
Voila! Disabling PrettyUrl and I am able to access the backend now.
Sigh… I thought about disabling pretty url a while ago, but I didn’t think it would be the source of my problem. Figured it had to be something I was doing wrong.
Now the question is, is there something that needs to happen with prettyUrl? I’d really like to use it if possible.
Nevermind, I figured it out. Needed to create another “server” configuration for the subdomain. Ironically, this is actually easier than what I was trying to do up above.