ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Nginx Serverblock for Bookstack

    IT Discussion
    bookstack nginx
    1
    2
    1.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • wirestyle22W
      wirestyle22
      last edited by wirestyle22

      My Bookstack install doesn't like HTTPS. It's fine when I am accessing via HTTP (although I am forcing HTTPS right now.

      Bookstack documentation says nginx server block needs to contain

      location / {
          try_files $uri $uri/ /index.php?$query_string;
      }
      

      Anytime I attempt to add the above it breaks.

      server {
          client_max_body_size 40M;
          server_name wiki.domain.com;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header Host $http_host;
          proxy_set_header X-NginX-Proxy true;
          proxy_redirect off;
          location / {
              proxy_set_header X-Real-IP $remote_addr;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header Host $http_host;
              proxy_set_header X-NginX-Proxy true;
              proxy_pass http://192.168.1.206;
              proxy_redirect off;
              # Socket.IO Support
              proxy_http_version 1.1;
              proxy_set_header Upgrade $http_upgrade;
              proxy_set_header Connection "upgrade";
      
      }
          ssl_stapling on;
          ssl_stapling_verify on;
          ssl_session_cache shared:SSL:10m;
          add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
      
          listen 443 ssl; # managed by Certbot
          ssl_certificate /etc/letsencrypt/live/wiki.domain.com/fullchain.pem; # managed by Certbot
          ssl_certificate_key /etc/letsencrypt/live/wiki.domain.com/privkey.pem; # managed by Certbot
          include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
          ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
      
      }
      server {
          client_max_body_size 40M;
          listen 80;
          server_name wiki.domain.com;
          rewrite        ^ https://$server_name$request_uri? permanent;
      }
      
      

      What am I missing? I installed this via their install script on Ubuntu 16.04.

      1 Reply Last reply Reply Quote 0
      • wirestyle22W
        wirestyle22
        last edited by wirestyle22

        nano /var/www/bookstack/.env contains a commented line for APP_URL=http://bookstack.dev. Uncommenting it and changing it to APP_URL=https://wiki.domain.com fixed the issue for me.

        1 Reply Last reply Reply Quote 2
        • 1 / 1
        • First post
          Last post