Mobileread
Calibre http to https nginx reverse proxy issue
#1  vinuabe4 01-18-2020, 11:30 PM
I have installed calibre web server on ubuntu server and I used nginx reverse proxy to enable SSL. Please find my below mentioned calibre nginx config.
Code
server {
listen 80;
server_name ebooks.everly.to;
location / { proxy_buffering off; proxy_pass http://78.46.187.23:8080$request_uri;
return 301 https://$server_name$request_uri; }
}
server {
listen 443;
server_name ebooks.everly.to;
ssl on; ssl_certificate /opt/certificate.crt; ssl_certificate_key /opt/private.key; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers HIGH:!aNULL:!MD5; access_log /var/log/calibre-server-access.log; error_log /var/log/calibre-server-error.log info; proxy_set_header X-Forwarded-For $remote_addr;
location /calibre/web/ {
proxy_set_header Host $http_host; # The line below is the key line you need: proxy_set_header X-Scheme $scheme; 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; proxy_intercept_errors on; proxy_http_version 1.1; proxy_pass http://78.46.187.23:8080;}
}
but when I using "return 301 https://$server_name$request_uri;" to forward http traffic to https I am getting "Failed to communicate with "/interface-data/init?1579406936518", network error. Is the server running and accessible?" error

please help me with this
Reply 

#2  vinuabe4 01-20-2020, 02:03 AM
bump..
Reply 

#3  kovidgoyal 01-20-2020, 08:01 AM
WHy is your proxy section so complex? Just use the basic one described here: https://manual.calibre-ebook.com/server.html

And look at the logs of both nginx and the calibre server to see what the issue might be.
Reply 

Today's Posts | Search this Thread | Login | Register