Hi all,
For some reason SSL only works for the login page, as soon as I login I get the following error:
I’ve setup a reverse proxy with nginx.
Hi all,
For some reason SSL only works for the login page, as soon as I login I get the following error:
I’ve setup a reverse proxy with nginx.
I’m going to guess you forgot to move the location /media
to the port 443
server with ssl on
. That section should contain only a redirect, like this:
server {
listen 80;
server_name seafile.example.com;
rewrite ^ https://$http_host$request_uri? permanent; # force redirect http to https
server_tokens off;
}
Provide more info on your nginx config if you want a more accurate answer.
https://download.seafile.com/published/seafile-manual/deploy/https_with_nginx.md
Thank you for the reply. I’m not sure of the location /media
as my nginx is on another machine. Are you reffering to this?
location /media {
root /home/user/haiwen/seafile-server-latest/seahub;
}
Here is my current nginx config:
##
## HTTP 80
##
server {
listen 80;
server_name domain.seafile.com;
rewrite ^ https://$http_host$request_uri? permanent;
return 301 https://domain.seafile.com$request_uri;
server_tokens off;
}
##
## HTTPS 443
##
server {
listen 443 ssl;
server_name domain.seafile.com;
access_log "C:/nginx/logs/domain/access.log";
error_log "C:/nginx/logs/domain/error.log";
include domain-ssl.conf;
include domain-common.conf;
location / {
proxy_headers_hash_max_size 512;
proxy_headers_hash_bucket_size 64;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://172.16.16.8:8000;
proxy_ssl_session_reuse off;
proxy_set_header Host $http_host;
proxy_cache_bypass $http_upgrade;
proxy_redirect off;
proxy_read_timeout 90;
}
location /fs {
rewrite ^/fs(.*)$ $1 break;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://172.16.16.8:8082;
proxy_set_header Host $host:$server_port;
proxy_connect_timeout 36000s;
proxy_read_timeout 36000s;
proxy_send_timeout 36000s;
send_timeout 36000s;
client_max_body_size 4096M;
}
include php.conf;
}