Due to the domain splitting work being done #17, there will be a lot of duplicated assets since none of the domains are set to access anything outside of their root folder. To remedy this, we should add a shared resource folder to the /var/www/html folder that all of the sites can access.
This will require:
- Changing the Frontend repos build process to include creating a
shared or static folder which will contain all the shared assets
/var/www/html
├── shared // new folder that contains shared assets
│ └── js
│ └── css
│ └── components // common web components for static sites
│ └── images // all images
├── ng
│ └── // The Angular app stuff, I'll figure this part out later
├── <subdomain>
- Updating
nginx.conf to have every site have access to this static folder, looking like this:
# nginx.conf
server {
server_name <subdomain>.sfucsss.org;
root /var/www/html/<subdomain>;
location / {
# subdomain stuff
}
location /shared/ {
alias /var/www/html/shared/;
...
}
}
- Update the links in the static sites to access this shared resource
<!-- *.html -->
<link rel="stylesheet" href="/shared/css/...">
<script src="/shared/js/..."></script>
<img src="/shared/images/..." />
/* *.css */
div {
background-image: url('/shared/<path to file>');
}
Due to the domain splitting work being done #17, there will be a lot of duplicated assets since none of the domains are set to access anything outside of their root folder. To remedy this, we should add a shared resource folder to the
/var/www/htmlfolder that all of the sites can access.This will require:
sharedorstaticfolder which will contain all the shared assets/var/www/html ├── shared // new folder that contains shared assets │ └── js │ └── css │ └── components // common web components for static sites │ └── images // all images ├── ng │ └── // The Angular app stuff, I'll figure this part out later ├── <subdomain>nginx.confto have every site have access to this static folder, looking like this: