I'm trying to redirect mywebsite.com/some-directory to a different directory other than the root of mywebsite.com. I used the following configuration :
server {
server_name mywebsite.com www.mywebsite.com;
listen 80;
root /path/to/the/root/directory/of/mywebsite;
index index.php index.html index.htm get.html ;
ssl on;
listen 443 ssl;
ssl_certificate my_ssl.crt;
ssl_certificate_key my_key.key;
location /some-directory {
root /path/to/directory;
}
}
The configuration loads the html file but doesn't load the assets in the same directory.
I found a similar question (or probably the exact one), but the issue was different. I was able to fix that on my own.
I also tried using the alias as suggested in the answer above; but in vain.
My /path/to/directory/
has some-directory
within it, and nginx serves the index.html file just fine. The problem occurs when the HTML file tries to access the files (or folders) within /path/to/directory/some-directory
. They all return 404 Not Found.
What could I be doing wrong?