nginx 404 Not Found error
Closed this issue · 7 comments
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?
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.
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?
@razzaghi What is your current config for this site/host in nginx?
My docker-compose
version: '2'
services:
mysql:
image: mysql:8.2
environment:
- MYSQL_ROOT_PASSWORD=xxxxxxx
- MYSQL_DATABASE=bookstack
- MYSQL_USER=bookstack
- MYSQL_PASSWORD=xxxxxxx
volumes:
- mysql-data:/var/lib/mysql
bookstack:
image: solidnerd/bookstack:23.12.1
depends_on:
- mysql
environment:
- DB_HOST=mysql:3306
- DB_DATABASE=bookstack
- DB_USERNAME=bookstack
- DB_PASSWORD=xxxxxxx
#set the APP_ to the URL of bookstack without without a trailing slash APP_URL=https://example.com
- APP_URL=http://kms.xxxxxxx.com
# APP_KEY is used for encryption where needed, so needs to be persisted to
# preserve decryption abilities.
# Can run php artisan key:generate to generate a key
- APP_KEY=xxxxxxx
volumes:
- uploads:/var/www/bookstack/public/uploads
- storage-uploads:/var/www/bookstack/storage/uploads
ports:
- "8080:8080"
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
}
~
@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/?

