在我的NAS上,我運行seafile作爲dropbox/owncloud的替代方案。我使用nginx和反向代理來使用/強制SSL服務webgui。這一切工作正常。nginx反向代理 - 僅適用於/
現在,我想爲其他NAS上運行的其他位置(沙發馬鈴薯,叢等)設置一些其他位置。這是我的nginx.conf文件的相關部分:
server {
listen 80;
server_name domain.net, 192.168.1.50;
rewrite^https://$http_host$request_uri? permanent; # force redirect http to https
}
server {
listen 443;
ssl on;
ssl_certificate C:/nginx-1.6.3/conf/ssl/ssl-bundle.crt; # path to your ssl certificate
ssl_certificate_key C:/nginx-1.6.3/conf/ssl/server.key; # path to your private key
server_name domain.net, 192.168.1.50;
proxy_set_header X-Forwarded-For $remote_addr;
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
server_tokens off;
location /couchpotato {
proxy_pass http://127.0.0.1:5050;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /cloud {
fastcgi_pass 127.0.0.1:8000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param HTTPS on;
fastcgi_param HTTP_SCHEME https;
access_log logs/seahub.access.log;
error_log logs/seahub.error.log;
}
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;
}
location /seafmedia {
rewrite ^/seafmedia(.*)$ /media$1 break;
root C:/Seafile/seafile-server-4.0.6/seahub;
}
location /media {
root C:/Seafile/seafile-server-4.0.6/seahub;
}
}
訪問domain.net/cloud(或192.168.1.50/cloud)讓我沒有問題seafile。參觀domain.net給我的默認nginx的頁面,這是有道理的,因爲沒有位置爲
的問題是要domain.net/couchpotato定義需要我https://domain.net/#couchpotato並在犯規負荷
如果nginx.conf文件更改location /couchpotato {}
到location/{}
然後couchpotato將加載正確
Im相當肯定那裏有一些錯誤的方式,我已經配置nginx的,但使用它
林不知道那是什麼,因爲這是我第一次所以我的問題是,爲什麼它使用/ couchpotato作爲位置不起作用?但使用/做?