Open ankonaskiff17 opened 1 month ago
To address the 404 error during the manual installation of Mainsail on your Raspberry Pi, ensure your NGINX configuration is correctly set up and handle the authentication prompt effectively.
Verify Configuration:
Ensure your NGINX configuration file (/etc/nginx/sites-available/mainsail
) is correctly set up. Here is a sample configuration:
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /server/ {
proxy_pass http://localhost:7125/;
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-Proto $scheme;
}
include /etc/nginx/extra-conf.d/*.conf;
}
Place Mainsail Files:
Ensure the Mainsail files are in the directory specified in the root
directive (/usr/share/nginx/html
).
Enable Configuration: Create a symbolic link to enable the configuration:
sudo ln -s /etc/nginx/sites-available/mainsail /etc/nginx/sites-enabled/
The authentication prompt when restarting NGINX is expected. Run the commands individually to handle the password prompt correctly:
Create Mainsail Directory:
mkdir ~/mainsail
Remove Default NGINX Site:
sudo rm /etc/nginx/sites-enabled/default
Enable Mainsail Configuration:
sudo ln -s /etc/nginx/sites-available/mainsail /etc/nginx/sites-enabled/
Restart NGINX:
sudo systemctl restart nginx
After completing these steps, verify the Mainsail backend server is running and accessible at localhost:7125
:
curl http://localhost:7125/server/info
If the server info is correctly returned, you should be able to access it via http://<printer-ip>/server/info
.
Following these steps should resolve the 404 error and handle the authentication prompt effectively. If you encounter further issues, please provide additional details for further assistance.
To continue the conversation, mention @dosu.
Mainsail Version:
2.11.0
Browser:
Other (Please tell us below)
Device:
Other (Please tell us below)
Operating System:
Other (Please tell us below)
What happened?
While working my way through a manual install of Mainsail (NOT MainsailOS) on a RasPi running current version of Pi OS installed via the Pi Imager. When I got to what I will call the first check, prior to NGINX installation entered the command
http://<printer-ip>:7125/server/info
everything checked good in that I got the big block of information that was expected. The next step, Install web server & reverse proxy (NGINX) I worked my way through the process, mostly just copy/pasting the various lines and generating files using Nano. On the second check by enteringhttp://<printer-ip>/server/info
I got a 404 error on the web page. Went back through the whole NGINX process line by line in the event I had a typo or a Nano file didn;t get written. Everything was there and in the correct locations. The very last stepsudo systemctl restart nginx
I think is the problem because when I executed that restart nginx, I got this.Once I entered my password, I got the below
What did you expect to happen instead?
I was not expecting a 404 error. Was hoping I got server info.
How to reproduce this bug?
I think if you just follow the process as written for a manual installation it should cause the same problem since there is no mechanism in a copy/paste process to accomodate password entry.
Instead of
Instead
And instruct user to then do single line because when I did the entire block I did not get any error or request for password
Additional information:
I have noticed that PiOS is getting really tight with things requiring user Pi's password compared to past practice. It's been several months since I have messed with any Pi's and my memory is thinking that using sudo was good enough. In this instance I needed both sudo and my password.