Welcome! Log In Create A New Profile

Advanced

html does not display photo

Posted by johnaaronrose 
html does not display photo
October 30, 2024 07:00AM
nginx is running Ok on my Raspberry PI server. In my www directory, I have html and images directories, with html being the root for my website of johnrose.mywire.org. When I double click the summer.html file in the html directory (in File Manager) it shows the photo but doesn't show it when I externally use a URL of johnrose.mywire.org/summer
summer.html is:
<!DOCTYPE html>
<html>
<head>
<style>
img {
width: 100%;
height: 100%;
}
</style>
</head>
<body>

<h1><b>Summer the Cat</b></h1>
<br>
<img src="../images/summer.jpg" alt="Summer" width="400" height="300">
<br>
<p><b>Life is so hard</b></p>
<br>

</body>
</html>

summer.jpg is in the images directory.
Attachments:
open | download - johnrose.mywire.org (991 bytes)
Re: html does not display photo
October 31, 2024 02:34AM
Attached is my nginx.conf
Attachments:
open | download - nginx.conf (1.4 KB)
Re: html does not display photo
November 01, 2024 04:36AM
A clarification I've also tried https://johnrose.mywire.org/summer as I'm using certbot for johnrose.mywire.org and certbot has created appropriate encrypting info for johnrose.mywire.org



Edited 1 time(s). Last edit at 11/01/2024 04:36AM by johnaaronrose.
Re: html does not display photo
November 05, 2024 07:24AM
The appropriate server block for johnrose.mywire.org is:

# Virtual Host configuration for johnrose.mywire.org
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
server {

server_name johnrose.mywire.org;

root /home/manager/www/html;
index index.html;

location / {
try_files $uri $uri/ =404;
}

listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/johnrose.mywire.org/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/johnrose.mywire.org/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {
if ($host = johnrose.mywire.org) {
return 301 https://$host$request_uri;
} # managed by Certbot


listen 80;
listen [::]:80;

server_name johnrose.mywire.org;
return 404; # managed by Certbot


}

My feeling is that I should change the above root to /home/manager/www and add an alias or location both for the html sub-directory and for the images sub-directory (of the root directory). Is that correct?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 234
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready