0

I have an Nginx server/site installed on my Raspberry pi and runs on https://example.com.

I also have a Calibre ebook server on the same Raspberry pi that runs on https://example.com:8585. Having a port number at the end is ugly and not easy to remember.

I want my Calibre server to be accessible at https://example.com/calibre

Is there a setting in the Nginx server that I can tweak to achieve this? I am new to web server setups. Any suggestions would be helpful. Thanks!

Rohit Farmer
  • 319
  • 4
  • 15
  • Have you read the Nginx documentation yet? Please provide any ideas you have tried and how they failed. – sativay Dec 12 '20 at 14:09

1 Answers1

0

Two simple ways. First - create location /calibre which cuts "/calibre" and pass requests to 8585 (trailng slash at end of proxy_pass is important)

server {
  ...

  location /calibre {
    proxy_pass https://example.com:8585/;
  }

  ...
}

Second (and better I think) way - to create subdomain calibre.example.com in your DNS and make another server{} for calibre like this

server {
  listen 443 ssl;

  ... ssl options here...

  server_name calibre.example.com;
  location / {
    proxy_pass https://example.com:8585;
  }
}
YuriB.
  • 46
  • 1