chsasank / outline-wiki-docker-compose

Installation and docker compose to self host outline wiki: https://www.getoutline.com/
295 stars 77 forks source link

(External) Nginx Reverse Proxy Config #1

Closed MDXDave closed 3 years ago

MDXDave commented 4 years ago

In order to use a external nginx with reverse proxy, you have to configure your files after the first init manually like this:

env.outline:

url=https://outline.example.com # without port
...
AWS_S3_UPLOAD_BUCKET_URL=https://outline.example.com # without port
...
host=outline.example.com

docker-compose.yml:

...
nginx:
    image: nginx
    ports:
      # Bind to localhost, instead of 8082 you can use any other (free) port
      - "127.0.0.1:8082:80"
      # Comment out - 4443:443
...

After this rebuild your container:

docker-compose up --build -d

Create a nginx config file for your external nginx (dont forget to replace IPv4/IPv6 with your real ip address):

server {
    listen IPv4:443 ssl http2;
    listen [IPv6]:443 ssl http2;
    listen IPv4:80;
    listen [IPv6]:80;
    server_name outline.example.com;

    ssl_certificate /etc/ssl/outline.example.com.pem;
    ssl_certificate_key /etc/ssl/outline.example.com.key;

    add_header Strict-Transport-Security "max-age=31536000; preload";
    add_header HTTPS "on";

    root /var/www/default;

    if ($ssl_protocol = "") {
        return 301 https://$server_name$request_uri;
    }

     location / {
        ssi on;
        proxy_pass http://localhost:8082/;
        proxy_set_header Host $host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

     location /realtime {
        proxy_pass http://localhost:8082/realtime;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $http_connection;
        proxy_read_timeout 86400;
    }
}
chsasank commented 4 years ago

Thanks for the instructions!

cmsax commented 3 years ago

Thanks! It works for me~

xaralis commented 3 years ago

Somehow, the WS forwarding still doesn't seem to work on my end :(

image

Also, there are issues with MinIO installation (both internet-facing/production and local setup). Getting Access Denied for anything I upload:

image

Anyone has any pointers on what's wrong?

MDXDave commented 3 years ago

@xaralis for the 2nd issue you need to set the permission for minio to download: https://github.com/outline/outline/issues/1912

JrmyDev commented 3 years ago

@xaralis did you manage to fix the ws forwarding ? thanks

abdou-ghonim commented 2 years ago

@xaralis I have the same problem with the web socket did you fix it?

thanks

Snuupy commented 2 years ago

Websockets do not work for me as of v0.60.