Skip to content

Instantly share code, notes, and snippets.

@herkom-o-matic
Last active February 22, 2020 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save herkom-o-matic/6906ee63706eab03c272f28076d20ae8 to your computer and use it in GitHub Desktop.
Save herkom-o-matic/6906ee63706eab03c272f28076d20ae8 to your computer and use it in GitHub Desktop.
#you should not name the file with any extension, just "booksonic" or whatever
server {
listen 80;
server_name your-domain.com; //change this
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name your-domain.com; //change this
ssl_certificate /route-to-your-certificate-file; //change this
ssl_certificate_key /route-to-your-certificate-keyfile; //change this
location / {
proxy_bind $server_addr;
proxy_pass http://127.0.0.1:4040; //use your server port, BUT the address should be your PRIVATE address
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Script-Name /booksonic;
proxy_redirect http:// https://;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment