Bonjour à tous !
J'ai récemment fait l'acquisition d'un VPS.
J'ai donc décidé d'en faire une Seedbox et du streaming.
J'ai donc installé RuTorrent + Cakebox Light, j'ai également mis en place du HTTPS.
Pourquoi du HTTPS ? Principalement car je suis en résidence étudiante et ce genre de système est totalement prohibé. Le HTTPS me permet d'être plus ou moins invisible auprès de l'administrateur réseau.
ruTorrent est parfaitement fonctionnel et je peux y accéder par
https://domaine/rutorrent
Pour ce qui est de CakeBox c'est un vrai autre problème que j'essaie de résoudre depuis deux jours.
Actuellement j'en suis à une erreur :
403 Forbidden quand j'essaie d'y accéder par https://domaine/cakebox
J'ai utilisé le tutoriel disponible sur ce même site.
Je ne tiens pas à faire du multi user donc j'ai touché à
default et cakebox.conf.
Je fonctionne en ALIAS et cakebox se situe dans:
/var/www/cakebox/
Voici mes fichiers conf:
default
server {
listen 80;
server_name mondomaine.fr;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name mondomaine.fr;
root /var/www/;
index index.html index.php index.htm;
ssl_certificate /etc/ssl/ruweb.crt;
ssl_certificate_key /etc/ssl/ruweb.key;
ssl_session_timeout 5m;
location / {
try_files $uri $uri/ =404;
}
location /rutorrent {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
include /etc/nginx/conf.d/php;
include /etc/nginx/conf.d/cache;
}
include /etc/nginx/conf.d/rtdload;
location ~ /\.ht {
deny all;
}
}
cakebox.conf:
server {
listen 80 default_server;
server_name _;
#replacement for htaccess, uncomment if you want
#auth_basic "Restricted";
#auth_basic_user_file "/etc/nginx/htpasswd";
location /cakebox/ {
rewrite ^/cakebox(/.*)$ $1 break;
proxy_pass http://127.0.0.1:81;
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_redirect off;
}
#alias for download and streaming
#replace /YOUR/PATH with the same path as cakebox.root variable in app/config/
location /access/ {
alias /home/bryan/rtorrent/downloads/;
allow all;
satisfy any;
add_header Content-Disposition "attachment";
}
}
server {
listen 81;
server_name _;
# only the proxy
allow 127.0.0.1;
deny all;
root /var/www/cakebox/public/;
access_log /var/log/nginx/cakebox-access.log;
error_log /var/log/nginx/cakebox-error.log;
#site root is redirected to the app boot script
location = / {
try_files @site @site;
}
#all other locations try other files first and go to our front controller if none of them exists
location / {
try_files $uri $uri/ @site;
}
#return 404 for all php files as we do have a front controller
location ~ \.php$ {
return 404;
}
#main configuration
location @site {
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
## use debug instead of production to get more log
fastcgi_param APPLICATION_ENV production;
fastcgi_param HTTPS on;
}
}
nginx.conf
user www-data www-data;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
client_max_body_size 40m;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log off;
error_log /var/log/nginx/error.log crit;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml applic$
##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##
#include /etc/nginx/naxsi_core.rules;
##
# nginx-passenger config
##
# Uncomment it if you installed nginx-passenger
##
#passenger_root /usr;
#passenger_ruby /usr/bin/ruby;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}
J'ai vu que le 403 pouvait être causé par des droits non suffisants, j'ai donc fait un chmod -R 775 sur /home mais toujours rien.
location /cakebox/ {
rewrite ^/cakebox(/.*)$ $1 break;
proxy_pass http://127.0.0.1:81;
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_redirect off;
}
#alias for download and streaming
#replace /YOUR/PATH with the same path as cakebox.root variable in app/config/
location /access/ {
alias /home/bryan/rtorrent/downloads/;
allow all;
satisfy any;
add_header Content-Disposition "attachment";
}
J'ai remarqué qu'en mettant le code ci-dessus dans default dans le server 443 ssl, je n'ai plus de 403 forbidden, le fond s'affiche bien (cupcakes) mais pleins d'erreurs de chargement de fichiers.J'arrive au même résultat en passant par:
https://domaine.fr/cakebox/public/index.html
J'ai bien besoin d'aide car là, ça me dépasse vraiment !
Merci à vous.