[SOLVED]WSGI Mode Setup Question

Recently upgraded to 6.2.5 Community Edition, Debian 8, Nginx

I need to switch to WSGI as it is necessary going forward.

Question I have is this. I know where to put the nginx config information but I don’t know where the Apache config update goes.I don’t have a httpd.conf file that I can find.

Do I need to update both nginx and apache sections for this to work. Or is this a one or the other?

Thanks for any assistance!

Do you use apache and nginx both together? I recommend to just use apache OR nginx.

1 Like

Thanks for your response. I use Nginx. It wasn’t clear to me as things weren’t working when I just made the nginx entry. Turns out from looking at the forum that it is more difficult than the manual indicated…

Here is my issue. When trying to access my site I get the following:

http://xxx.xxxxxx.net:443/accounts/login?next=/

400 Bad Request
The plain HTTP request was sent to HTTPS port
nginx

I have already make the change in the nginx config to:
proxy_set_header Host $host:$server_port;

In my seahub_settings.py I have SITE_BASE = ‘https://xxx.xxxxxx.net’ (domain obscured)

My nginx config, (only xxxx’s obscured):

server {
listen 80;
server_name “”;
return 301 https://$http_host$request_uri;

location ‘/.well-known/acme-challenge’ {
default_type “text/plain”;
root /opt/certbot-webroot;
}

}

server {
listen 443;
server_name “”;

ssl on;
ssl_certificate /etc/letsencrypt/live/xxx.xxxxxx.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/xxx.xxxxxx.net/privkey.pem;

proxy_set_header X-Forwarded-For $remote_addr;

location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host:$server_port;
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_read_timeout 1200s;

     # used for view/edit office file via Office Online Server
     client_max_body_size 0;

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

Etc.

I’m have also cleared the seahub cache.

When I try https://xxx.xxxxxx.net/api2/accounts/login?next=/
It will load the Seafile UI page and post “Sorry, but the requested page could not be found.” So seahub is up and running…

Thanks for any help. Appreciate the work being done on the community manual and this forum.

Why don’t use the nginx redirect option? That’s the common way: rewrite ^ https://$http_host$request_uri? permanent;

Edit: I think you forgot the permanent, but please change it to this way.

Tried your suggestion. Cleared browser cache.

Same issue.

Set nginx error log level to info. Here is what I get:

2018/09/19 12:27:20 [info] 18255#0: *23 client sent plain HTTP request to HTTPS port while reading client request headers, client: yy.yyy.yyy.yyy, server: xxx.xxxxxx.net, request: “GET /accounts/login?next=/ HTTP/1.1”, host: “xxx.xxxxxx.net:443

Note: everything worked under fastcgi…

Wow, it was messy but I eventually got it working. Can’t tell you definitively if I needed to do all of the steps below but after translating from:

I upgraded my nginx from jesse backports to

nginx version: nginx/1.10.3

and then added to my nginx config

proxy_set_header X-Forwarded-Proto https;

Then did the normal troubleshooting restart of everything…

Shut down Seahub and Seafile
Cleared Seahub Cache
Cleared Browser Cache
Service Nginx Stop and then Start
Started Seafile and Seahub

And, it works. Still some testing to be done…

Thought you’ve already kown this problem.