Skip to content

Commit

Permalink
update sdoc nginx conf
Browse files Browse the repository at this point in the history
  • Loading branch information
SkywalkerSpace committed Aug 31, 2023
1 parent 9b7540c commit b49b945
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion manual/extra_setup/setup_seadoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,47 @@ services:
#### Modify seafile.nginx.conf
Add the nginx configuration to the `seafile.nginx.conf`, the content is the same as above
Add the following to the `seafile.nginx.conf`:
```
location /sdoc-server {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,OPTIONS;
add_header Access-Control-Allow-Headers "deviceType,token, authorization, content-type";
if ($request_method = 'OPTIONS') {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,OPTIONS;
add_header Access-Control-Allow-Headers "deviceType,token, authorization, content-type";
return 204;
}

proxy_pass http://sdoc-server:7070;
proxy_redirect off;
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 $scheme;

client_max_body_size 100m;
}

location /socket.io {
proxy_pass http://sdoc-server:7070;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_redirect off;

proxy_buffers 8 32k;
proxy_buffer_size 64k;

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;
}
```
And reload nginx
Expand Down

0 comments on commit b49b945

Please sign in to comment.