Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Server

Notices

Reply
 
Thread Tools Search this Thread
Old 01-22-2021, 09:24 AM   #1
extensive
Junior Member
extensive began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2021
Device: Kobo
Calibre with nginx help please

Can anyone help with setting up my nginx reverse proxy? I have a few sites running on the same box. I am by no means an expert at nginx, I've just got ideas from the internet and got it to work for emby, radarr, sonarr, and lidarr. I would like to have calibre on the same box and working through nginx. Here is my conf section but I am getting this error.

Quote:
2021/01/22 09:17:51 [error] 17292#3208: *17 auth request unexpected status: 404 while sending to client, client: 192.168.66.1, server: EXTERNALADDRESSREMOVED, request: "GET /calibre HTTP/2.0", host: "EXTERNALADDRESSREMOVED"
Here is my conf file section
Quote:
location /calibre {
auth_request /auth-4;
proxy_pass http://127.0.0.1:7070;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 90;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Script-Name /calibre; # IMPORTANT: path has NO trailing slash
proxy_hide_header 'x-frame-options';
add_header x-frame-options "allowall";
proxy_redirect ~^(http(?:s)?://)([^:/]+)(?::\d+)?(/.*)?$ $1$2:$server_port$3;
}
extensive is offline   Reply With Quote
Old 01-22-2021, 09:30 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
What is auth_request and why do you have it there? That's what's causing your error.
kovidgoyal is offline   Reply With Quote
Old 01-22-2021, 10:38 AM   #3
extensive
Junior Member
extensive began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2021
Device: Kobo
Sorry I am not really sure what any of this stuff does...I just copy and paste from examples I get on the internet until it works. I removed it and now I get a 404. I would be willing to paypal you some funds if you want. Maybe another config in the conf file is messing with it?
Attached Thumbnails
Click image for larger version

Name:	404.PNG
Views:	208
Size:	7.0 KB
ID:	184881  
extensive is offline   Reply With Quote
Old 01-22-2021, 11:01 AM   #4
extensive
Junior Member
extensive began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2021
Device: Kobo
Code:
worker_processes  auto;

error_log  logs\error.log;

events {
    worker_connections  8192;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    server_names_hash_bucket_size 64;
    server_tokens off;

    ## The below will create a seperate log file for your emby server which includes
    ## userId's and other emby specific info, handy for external log viewers.
    log_format  emby  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for" $request_time $server_port "$http_x_emby_authorization"';

    log_format default '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for" $request_time $server_port';

    sendfile        off;  ## Sendfile not used in a proxy environment.

    gzip on;   ## Compresses the content to the client, speeds up client browsing.
	gzip_disable "msie6";

	gzip_comp_level 6;
	gzip_min_length 1100;
	gzip_buffers 16 8k;
	gzip_proxied any;
	gzip_types
	    text/plain
	    text/css
	    text/js
	    text/xml
	    text/javascript
	    application/javascript
	    application/x-javascript
	    application/json
	    application/xml
	    application/rss+xml
	    image/svg+xml;

    tcp_nodelay on;  ## Sends data as fast as it can not buffering large chunks, saves about 200ms per request.

	
	##include perfect-forward-secrecy.conf;
server {
    listen [::]:80;   		## Listens on port 80 IPv6
    listen 80; 			## Listens on port 80 IPv4
    listen [::]:443 ssl http2;	## Listens on port 443 IPv6 with http2 and ssl enabled
    listen 443 ssl http2;	## Listens on port 443 IPv4 with http2 and ssl enabled

    server_name server.extensivesnare.info;    ## enter your service name and domain name here example emby.domainname.com

	access_log  logs\access.log  emby;  ## Creates a log file with this name and the log info above.

    ## SSL SETTINGS ##
    ssl_session_timeout 30m;
    ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
	ssl_certificate      ssl/emby.pem;  ## Location of your public PEM file.
	ssl_certificate_key  ssl/private.key;  ## Location of your private PEM file.
    ssl_session_cache shared:SSL:10m;
	
     location / {
					proxy_pass http://127.0.0.1:8096;  ## Enter the IP and port of the backend emby server here.

					proxy_hide_header X-Powered-By;	 ## Hides nginx server version from bad guys.
					proxy_set_header Range $http_range;  ## Allows specific chunks of a file to be requested.
					proxy_set_header If-Range $http_if_range;  ## Allows specific chunks of a file to be requested.
					proxy_set_header X-Real-IP $remote_addr;  ## Passes the real client IP to the backend server.
					proxy_set_header Host $host;  ## Passes the requested domain name to the backend server.
					proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  ## Adds forwarded IP to the list of IPs that were forwarded to the backend server.

					 ## ADDITIONAL SECURITY SETTINGS ##
					 ## Optional settings to improve security ##
					 ## add these after you have completed your testing and ssl setup ##
					add_header 'Referrer-Policy' 'origin-when-cross-origin';
					add_header Strict-Transport-Security "max-age=15552000; preload" always;
					add_header X-Frame-Options "SAMEORIGIN" always;
					add_header X-Content-Type-Options "nosniff" always;
					add_header X-XSS-Protection "1; mode=block" always;

					 ## WEBSOCKET SETTINGS ## Used to pass two way real time info to and from emby and the client.
					proxy_http_version 1.1;
					proxy_set_header Upgrade $http_upgrade;
					proxy_set_header Connection $http_connection;
						
						
						proxy_connect_timeout 1h;
						proxy_send_timeout 1h;
						proxy_read_timeout 1h;
					}
		location /sonarr {
		proxy_pass http://127.0.0.1:8989;
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	}
	
			location /radarr {
		proxy_pass http://127.0.0.1:7878;
		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_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection $http_connection;
	}
				location /lidarr {
		proxy_pass http://127.0.0.1:9008;
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	}
	
				location /calibre {
		proxy_buffering off;
		proxy_set_header X-Forwarded-For $remote_addr;
		proxy_pass http://127.0.0.1:7070$request_uri;
        }
		}
}
extensive is offline   Reply With Quote
Old 01-22-2021, 10:18 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The place to get a correct example for the nginx config is in the calibre user manual, the general internet is full of wrong advice. https://manual.calibre-ebook.com/ser...-other-servers

And I'm afraid I dont have time to help you debug the nginx issue in detail, sorry.
kovidgoyal is offline   Reply With Quote
Old 01-23-2021, 06:22 AM   #6
extensive
Junior Member
extensive began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2021
Device: Kobo
Code:
[192.168.66.1 - - [23/Jan/2021:06:18:44 -0500] "GET /calibre/ HTTP/2.0" 404 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36" "-" 0.002 443 "-"
I tried your example already. doesn't work unfortunately Can anybody help?
extensive is offline   Reply With Quote
Old 01-23-2021, 06:33 AM   #7
extensive
Junior Member
extensive began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2021
Device: Kobo
works! i put /calibre in the url prefix in settings. thanks!
extensive is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre http to https nginx reverse proxy issue vinuabe4 Server 2 01-20-2020 08:01 AM
nginx rev pxy /w wildcard ssl cert - you are not authorized to view this site alexauran Server 1 09-24-2019 02:45 AM
Any suggestions? Intermittant problems with Content Server/NGINX haertig Calibre 4 02-28-2018 12:50 AM
Need help: Using NGINX as reverse-proxy for Calibre haertig Related Tools 5 11-18-2017 08:54 PM
Nginx Calibre Proxy Ackis Calibre 2 04-19-2016 01:48 PM


All times are GMT -4. The time now is 11:03 PM.


MobileRead.com is a privately owned, operated and funded community.