solidnerd / docker-bookstack

BookStack in a container
MIT License
448 stars 194 forks source link

nginx 404 Not Found error #462

Closed razzaghi closed 4 months ago

razzaghi commented 5 months ago

I clone repo done below actions: 1-Change docker-compose.yml configs 2-Set .env file 3-docker-compose up -d every things going well but when I open app url in browser i get below error image

What can i do?

ssddanbrown commented 5 months ago

I don't think this image even uses/contains nginx, indicating this may be an issue elsewhere. Are you using an nginx proxy in front of your containers or on the host server?

rjhenry commented 5 months ago

As @ssddanbrown mentioned, this image doesn't use nginx anywhere, so there's something else going on here. Also note that there should not be an .env file in use - instead, set variables in the docker-compose.yml file. Finally, to troubleshoot issues please provide logs of the Bookstack container to help us see what's going on.

razzaghi commented 5 months ago

I found problem. I have another services on nginx on my vps. I need to set port number on APP_URL http://kms.xxxxx.com:8080 I try to setup a revers proxy on my Nginx.to remove 8080 but it doesn't work. Can you help me how can i do that?

ssddanbrown commented 5 months ago

@razzaghi What is your current config for this site/host in nginx?

razzaghi commented 5 months ago

My docker-compose version: '2' services: mysql: image: mysql:8.2 environment:

volumes: mysql-data: uploads: storage-uploads:

My Nginx config server { server_name kms.xxxxxxx.com;

client_max_body_size 200M;

# Reverse proxy the uwsgi Django request
location / {
    #include proxy_params;
    proxy_pass http://localhost:8080;

    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";

    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Host $server_name;
    proxy_set_header X-Forwarded-Proto https;

}

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/kms.xxxxxxx.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/kms.xxxxxxx.com/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 = kms.xxxxxxx.com) { return 301 https://$host$request_uri; } # managed by Certbot

server_name kms.xxxxxxx.com;

listen 80;
return 404; # managed by Certbot

} ~

ssddanbrown commented 5 months ago

@razzaghi Since you're using HTTPS via nginx, update your APP_URL to start with https:// instead of http://. Then re-up your bookstack container (not just restart, since the container needs to be re-created).

After that, what do you see when going to https://kms.xxxxxxx.com/?

razzaghi commented 5 months ago

Great. It's worked. Thank you so much image Before this, kms was loaded, but the media was not loaded. it just got fixed.