Fixing 50x.html links. Displaying 50x.html when requested directly.

This commit is contained in:
Roland 2023-07-15 12:15:55 -06:00
parent 7f67d4c07e
commit b3068885b2
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
4 changed files with 18 additions and 9 deletions

View file

@ -50,20 +50,20 @@
// Get the current hostname (probably an IP) link to my other ports above.
let hostname = window.location.hostname;
let api_a = document.getElementById('map_link');
let media_a = document.getElementById('media_link');
if (media_a) {
let media_url = `http://${hostname}:8080/media`;
media_a.setAttribute('href', media_url);
media_a.textContent = `by navigating to ${media_url}`;
}
let api_a = document.getElementById('api_link');
if (api_a) {
let api_url = `http://${hostname}:8081`;
api_a.setAttribute('href', api_url);
api_a.textContent = `by navigating to ${api_url}`;
}
let media_a = document.getElementById('media_link');
if (media_a) {
let media_url = `http://${hostname}/media`;
media_a.setAttribute('href', media_url);
media_a.textContent = `by navigating to ${media_url}`;
}
let map_a = document.getElementById('map_link');
if (map_a) {
let map_url = `http://${hostname}:8084`;
@ -71,7 +71,7 @@
map_a.textContent = `by navigating to ${map_url}`;
}
let kiwix_a = document.getElementById('map_link');
let kiwix_a = document.getElementById('kiwix_link');
if (kiwix_a) {
let kiwix_url = `http://${hostname}:8085`;
kiwix_a.setAttribute('href', kiwix_url);

View file

@ -86,6 +86,7 @@ services:
- ${WEB_HOST-0.0.0.0}:${WEB_PORT-8080}:80
volumes:
- './nginx.dev.conf:/etc/nginx/nginx.conf'
- './50x.html:/var/www/50x.html'
- './icon.ico:/etc/nginx/favicon.ico'
- './icon.png:/etc/nginx/icon.png'
- './test:/opt/media'

View file

@ -40,6 +40,10 @@ http {
alias /opt/wrolpi/icon.png;
}
location /50x.html {
alias /error/50x.html;
}
location /epub/epub.html {
alias /opt/wrolpi/app/public/epub/epub.html;
}

View file

@ -30,6 +30,10 @@ http {
alias /etc/nginx/icon.png;
}
location /50x.html {
alias /var/www/50x.html;
}
location / {
# React APP
proxy_pass http://app:3000;