Nginx 1.12.2 connection problem without fastcgi (Server 6.2.2)

Hi everyone.

I updatet my seafile server from 6.1.2 to 6.2.2 and I want not to use my old nginx fast-cgi config. I wanted to use it without fastcgi now. The server works fine, but nginx doesn’t redirect my connection to the seafile server. I updatet nginx to version 1.12.2 too. Here is my sites-enabled config. Maybe I have a stupid error in it and someone can help me? :slight_smile:

(I changed my server_name to MY.SERVER.COM in this example ^^)

server {
    listen 80;
    server_name MY.SERVER.COM;
    rewrite ^ https://$http_host$request_uri? permanent;    # force redirect http to https

    # Enables or disables emitting nginx version on error pages and in the "Server" response header field.
    server_tokens off;
}

server {
    listen 8001;
    ssl on;
    ssl_certificate /etc/nginx/ssl/seahub.crt;        # path to your cacert.pem
    ssl_certificate_key /etc/nginx/ssl/seahub.key;    # path to your privkey.pem
    server_name MY.SERVER.COM;
    server_tokens off;

    location / {
    proxy_pass         http://127.0.0.1:8000;
    proxy_set_header   Host $host;
    proxy_set_header   X-Real-IP $remote_addr;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header   X-Forwarded-Host $server_name;
    proxy_set_header   X-Forwarded-Proto https;

    access_log      /var/log/nginx/seahub.access.log;
    error_log       /var/log/nginx/seahub.error.log;

    proxy_read_timeout  1200s;

    client_max_body_size 0;
    }

    location /seafhttp {
        rewrite ^/seafhttp(.*)$ $1 break;
        proxy_pass http://127.0.0.1:8082;
        client_max_body_size 0;
        proxy_connect_timeout  36000s;
        proxy_read_timeout  36000s;
        proxy_send_timeout  36000s;
        proxy_request_buffering off;

        send_timeout  36000s;
    }
    location /media {
        root /home/seafile/haiwen/seafile-server-latest/seahub;
    }
}

When I try to visit the website over port 8001 wia https, the connection will be refused:

ERR_CONNECTION_REFUSED

Anyone an idea?

Greetings
MasterFox

Go to the announcement of raspberry pi 6.2.2 and then search for port 8001. In nginx is missing your port 8001, near the $host. It is easy for you if you update to listen on port 80 or 443. Your configuration is the old one unless that you want to listen in 8001 instead standard ports.

I found it and changed that:

...
server {
    listen 443;
    ssl on;
    ssl_certificate /etc/nginx/ssl/seahub.crt;        # path to your cacert.pem
    ssl_certificate_key /etc/nginx/ssl/seahub.key;    # path to your privkey.pem
    server_name MY.SERVER.COM;
    server_tokens off;

    location / {
    proxy_pass         http://127.0.0.1:8000;
    proxy_set_header   Host $host:8001;
...

But this doesn’t help. I think I does something wrong again… xD

No, if you change to 443, you should not put ,$host:port. Check the other configuration in /conf files for coherence.

Thx for your help!
After installing the nginx version 1.12.2, the nginx.conf was set to default.
SSL Support was missing and the include /etc/nginx/sites-enabled/*; too.

Now it’s working fine again. :slight_smile: